Can i perform a connection to sql server 2005 on a hook using ADO?
How can i do that cause im trying without any result
this is my code
Dim Value_Need As String
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New Connection
Set rst = New Recordset
cnn.Open "Provider=SQLNCLI;Server=ServerRMS;Database=RMSSampleDB;Uid=sa; Pwd=P@$$W0RD;", "sa", "P@$$W0RD"
' abrir el recordset indicando la tabla a la que queremos acceder
rst.Open "SELECT Password FROM Cashier WHERE Number = " & "'" & LastCashier & "'", cnn, adOpenDynamic, adLockOptimistic
' Asignar los nombres de los campos al combo
If Not rst.EOF And Not rst.BOF Then
rst.MoveFirst
Value_Need = rst.Fields("Password")
Else
Value_Need = ""
End If
' Cerrar el recordset y la conexión
rst.Close
cnn.Close
but getting error looks like i dont have register the dll for ADO connection but i verify and i have the same version.
If i try this code on a winform or class works fine but in the hook cant make work.
*This post is locked for comments
I have the same question (0)