Private Sub Command1_Click()
Set db = DBEngine.OpenDatabase(App.Path & "/db1.mdb")
Set rs = db.OpenRecordset("SELECT * FROM web2", dbOpenDynaset)
rs.MoveLast
b = rs!upid
rs.MoveFirst
a = rs!upid
On Error Resume Next
For c = a To b
txtsend.Text = rs!ip
Load tcpcl(tcpcl.UBound + 1)
tcpcl(tcpcl.UBound).LocalPort = 0
tcpcl(tcpcl.UBound).RemoteHost = txtsend.Text
tcpcl(tcpcl.UBound).RemotePort = 15124
tcpcl(tcpcl.UBound).Close
tcpcl(tcpcl.UBound).Connect
Sleep (1000)
DoEvents
If txtoutput.Text <> "" Then
If rs!message = "" Or IsNull(rs!message) Then
rs.Edit
rs!message = txtoutput.Text
rs.Update
ElseIf rs!message = txtoutput.Text Then
MsgBox "正常"
End If
txtoutput.Text = ""
End If
rs.MoveNext
Next
rs.Close
db.Close
MsgBox "ok"
End Sub
Private Sub Command1_Click()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\test.mdb;User Id=;Password=;"
dodc1.RecordSource = "SELECT * FROM web2"
Adodc1.Refresh
Adodc1.Recordset.MoveLast
b = Adodc1.Recordset("upid")
Adodc1.Recordset.MoveFirst
a = Adodc1.Recordset("upid")
On Error Resume Next
For c = a To b
txtsend.Text = Adodc1.Recordset("ip")
Load tcpcl(tcpcl.UBound + 1)
tcpcl(tcpcl.UBound).LocalPort = 0
tcpcl(tcpcl.UBound).RemoteHost = txtsend.Text
tcpcl(tcpcl.UBound).RemotePort = 15124
tcpcl(tcpcl.UBound).Close
tcpcl(tcpcl.UBound).Connect
Sleep (1000)
DoEvents
If txtoutput.Text <> "" Then
If Adodc1.Recordset("message") = "" Or IsNull(Adodc1.Recordset("message")) Then
Adodc1.Recordset.Edit
Adodc1.Recordset("message") = txtoutput.Text
Adodc1.Recordset.Update
ElseIf Adodc1.Recordset("message") = txtoutput.Text Then
MsgBox "正常"
End If
txtoutput.Text = ""
End If
Adodc1.Recordset.MoveNext
Next
MsgBox "ok"
End Sub