Advertisement
Advertisement
| 05.10.2008 at 01:17PM PDT, ID: 23392015 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: |
Public Class Form1
Public Shared CN1 As ADODB.Connection
Public Shared CM1 As ADODB.Command
Public Shared RS1 As ADODB.Recordset
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CN1 = New ADODB.Connection
CN1.CursorLocation = ADODB.CursorLocationEnum.adUseServer
CN1.Open("Provider=SQLOLEDB.1;Persist Security Info=False;Initial Catalog=sqldb;" & "Server=ss\sql;Integrated Security=SSPI")
listener.Start()
While True
Dim client As New connection(listener.AcceptTcpClient)
End While
End Sub
End Class
Public Class connection
Public Sub New(ByVal client As TcpClient)
ReDim data(_client.ReceiveBufferSize)
_client.GetStream.BeginRead(data, 0, _
CInt(_client.ReceiveBufferSize), _
AddressOf ReceiveMessage, Nothing)
End Sub
Public Sub ReceiveMessage(ByVal ar As IAsyncResult)
Dim RS1 = New ADODB.Recordset
RS1.Open("SELECT * FROM tbl WHERE unique_id = 123456789", Form1.CN1, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic, ADODB.CommandTypeEnum.adCmdText)
' do stuff with the data here
RS1.Close()
RS1 = Nothing
MsgBox("would be nice if it actually got this far!")
End Sub
End Class
|