• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

SQL ADO and VBA

wam2004

Limp Gawd
Joined
Aug 19, 2001
Messages
145
Is it possible to connect to an SQL database through ADO while in a Microsoft Access VBA enviornment? I cant quite seem to get this working. A sample connect string etc would be appreciated.
 
Code:
Dim cn As New ADODB.Connection
Dim strCS As String
strCS = "DRIVER={SQL Server};SERVER=PW-TEST;DATABASE=Inventory;UID=****;PWD=****"
cn.ConnectionString = strCS
cn.Open
Dim cmdCommand As New ADODB.Command
Dim rstRecordSet As New ADODB.Recordset
With cmdCommand
    .ActiveConnection = cn
    .CommandText = "SELECT GUID FROM Stock;"
    .CommandType = adCmdText
End With

With rstRecordSet
    .CursorType = adOpenStatic
    .CursorLocation = adUseClient
    .LockType = adLockOptimistic
    .Open cmdCommand
End With
Well I guess I put this up since I got it working. It might help someone else
 
Back
Top