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
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