Hi
I'll give you a brief run down.......
1) You need to have a reference to ADO, done by selecting from the menu > Project > References and check Microsoft ActiveX Data Ojects 2.X Library (assuming you have mdac installed - get this from microsoft if you dont)
2) Create connection and command objects....(this should come up with intellisense if you have it installed properly)
Dim Connection As New ADODB.Connection
Dim Command As New ADODB.Command
3) Login....
Connection.ConnectionString = "driver={SQL Server};server=YOURSERVER;uid=YOURUSER;pwd=YOUPASS WORD;database=YOURDATABASE"
Connection.Open
Command.ActiveConnection = Connection
4) Call your procedure
Dim ResultSet As New ADODB.Recordset
Command.CommandText = "YOURPROCEDURE"
Set ResultSet = Command.Execute
5) Work with you results
Dim value as String
If ResultSet.BOF = True And ResultSet.EOF = True Then
value = ResultSet.Fields(0)
End If
This is just 1 way, but it will give you an idea, but have a look for ADO on the net. You only asked for how to connect but I gave you the code to call a stored procedure also and this post should probably be in a
VB thread.
I hope this helps.