Imports System.Threading
Public Class FrmMornitorError
Private th As Thread
Private Sub _CheckDuplicate(ByVal _Table As String)
Call _Connect()
SB_Process("drop table tum_tempDoup purge")
Com = New OleDb.OleDbCommand(_Str, Conn)
Try
Com.ExecuteNonQuery()
Catch ex As Exception
End Try
SB_Process("create table tum_tempDoup as select a.* from erroredit a ," & _Table & " b where a.account_no=b.account_no and a.sub_a=b.sub_a and a.sub_b=b.sub_b and a.start_date=b.start_date and a.start_time=b.start_time")
Com = New OleDb.OleDbCommand(_Str, Conn)
Try
Com.ExecuteNonQuery()
Catch ex As Exception
End Try
SB_Process("delete from erroredit a where (a.account_no||a.sub_a||a.sub_b||a.start_date||a.start_time) in (select a.account_no||a.sub_a||a.sub_b||a.start_date||a.start_time from tum_tempDoup a)")
Com = New OleDb.OleDbCommand(_Str, Conn)
Try
Com.ExecuteNonQuery()
Catch ex As Exception
End Try
Conn.Close()
End Sub
'Sub Main(ByVal args As String())
' Dim t As New System.Threading.Thread(AddressOf ThreadStart)
' t.SetApartmentState(System.Threading.ApartmentState.STA)
' t.Start()
'End Sub
Private Sub _ProcessErrorCall(ByVal _Table As String, ByVal _Num As String)
Call _Connect()
SB_Process("INSERT INTO " & _Table & " SELECT a.BLOCK, a.account_no, a.sub_a, a.sub_b, a.start_date, a.start_time,a.caller_name, a.called_name, a.country, a.real_time, a.dur_charge,a.amount, a.call_type, a.ERROR_CODE, a.inc_route, a.out_route,a.sub_c, a.filename FROM erroredit a WHERE a.start_date >='" & Format(CDate(dpkFrom.Text), "dd/MM/yyyy") & "' and a.start_date <='" & Format(CDate(dpkTo.Text), "dd/MM/yyyy") & "' and a.LOCATIONB <> '***' AND SUBSTR (sub_a, 1, 4) IN (" & _Num & ")")
Com = New OleDb.OleDbCommand(_Str, Conn)
Try
Com.ExecuteNonQuery()
Catch ex As Exception
End Try
SB_Process(" delete from erroredit a where SUBSTR (sub_a, 1, 4) IN (" & _Num & ") and a.start_date >='" & Format(CDate(dpkFrom.Text), "dd/MM/yyyy") & "' and a.start_date <='" & Format(CDate(dpkTo.Text), "dd/MM/yyyy") & "' and a.LOCATIONB <> '***'")
Com = New OleDb.OleDbCommand(_Str, Conn)
Try
Com.ExecuteNonQuery()
Catch ex As Exception
End Try
Conn.Close()
End Sub
Private Sub btnFixError_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFixError.Click
End Sub
End Class