Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adodb connection and query

Status
Not open for further replies.

sirron

Programmer
Mar 11, 2004
139
US
I'm trying to connect to my sql server and do a query this is what I have right now.
Can someone help me.

Dim st As String
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset

'Open the connection
cn.Open "DSN=CSUsql;UID=WLinton;PWD=password;"

'Open the recordset
rs.Open "SELECT SPRIDEN_LAST_NAME FROM SPRIDEN WHERE SPRIDEN_LAST_NAME Like '*" & txtSearch & "*'", cn

While Not rs.EOF
Debug.Print rs!SPRIDEN_LAST_NAME
rs.MoveNext
Wend
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top