basshead22
Registered User.
- Local time
- Today, 07:27
- Joined
- Dec 17, 2013
- Messages
- 52
Hi guys i'm trying to establish a connection to my back end SQL Server using ADO ...but for some reason i am encountering some errors ... I get the compile error:syntax error and it hightlight the ADOConn.ConnectionString line.... i also get Compile error: Expected: end of statement when it gets to the trusted_connection part. ... .please help not sure what else to do.
This is set up so i don't have to indicate which Active X driver to use in case the other users have a different version than the one i have i.e. 6.1 Below is my code.
---------------------------------------------------------------------------
Option Compare Database
Option Explicit
_____________________________________________________
Public Sub ADOConnection()
Dim ADOConn As Object
Set ADOConn = CreateObject("ADODB.Connection")
ADOConn.ConnectionString = "Driver={SQL Server};Server=VLAXADGQASQL01;Database=TIMEKEEPING;"Trusted_Connection=Yes;"
ADOConn.Open
End Sub
This is set up so i don't have to indicate which Active X driver to use in case the other users have a different version than the one i have i.e. 6.1 Below is my code.
---------------------------------------------------------------------------
Option Compare Database
Option Explicit
_____________________________________________________
Public Sub ADOConnection()
Dim ADOConn As Object
Set ADOConn = CreateObject("ADODB.Connection")
ADOConn.ConnectionString = "Driver={SQL Server};Server=VLAXADGQASQL01;Database=TIMEKEEPING;"Trusted_Connection=Yes;"
ADOConn.Open
End Sub