Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 414
  • Last Modified:

I would like get the data from sql server TCP port 1433 using winsock control


code

Private Sub Form_Load()
    winsocktest.Protocol = sckTCPProtocol
    winsocktest.LocalPort = 1433
   ' winsocktest.Listen
End Sub


Private Sub winsocktest_ConnectionRequest( ByVal requestID As Long)
    winsocktest.LocalPort = 1433
    winsocktest.Accept requestID

End Sub

Private Sub winsocktest_DataArrival( ByVal bytesTotal As Long)
    Dim sItemData As String
   
    winsocktest.GetData sItemData, vbString
    MsgBox sItemData
End Sub



I want some vb code to get remote data and localhost data in binary format

Thanks in advance,
Mohan
0
Mohan_Raju
Asked:
Mohan_Raju
1 Solution
 
AzraSoundCommented:
Use ADO:
http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForSQLServer

Look under the section "To connect to SQL Server running on a remote computer (via an IP address)"
0
 
lunchbyteCommented:
I do not even think it is possible with winsock.

I use TCP and IP address to connect SQL Server using ADO like Azea mentioned.

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now