J
jelybeans
Can someone help me troubleshoot my connection string? I'm using Access 2007.
Here is my current code:
Function setCnxn() As ADODB.Connection
Dim cnxnStr As String
Set Cnxn = New ADODB.Connection
cnxnStr = cnxnStr = "Data Source=filepath.accdb;"
With Cnxn
.Mode = adModeShareDenyNone
.CursorLocation = adUseClient
.Open cnxnStr
End With
Set setCnxn = Cnxn
End Function
Here are some other strings I've tried:
cnxnStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=filepath.accdb;"
cnxnStr = "Provider=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft Access
Driver (*.mdb, *.accdb)};DBQ=C:filepath.accdb;Persist Security Info=False;"
cnxnStr = "Driver={Microsoft Access Driver (*.mdb,
*.accdb)};DBQ=C:\Users\Summer\Desktop\PMOBlotterDB\PMOBlotter.accdb; Persist
Security Info=False;"
I've read the ConnectionString.com site and hat's where I got my one of the
strings but it doesn't work either.
I've gotten several different error messages for each of the strings I've
tried. With the current string i'm getting:
Run-time error '-2147467259 (80004005)':
[Microsoft][ODBC Driver Manager] Data source name too long.
Please Help
Here is my current code:
Function setCnxn() As ADODB.Connection
Dim cnxnStr As String
Set Cnxn = New ADODB.Connection
cnxnStr = cnxnStr = "Data Source=filepath.accdb;"
With Cnxn
.Mode = adModeShareDenyNone
.CursorLocation = adUseClient
.Open cnxnStr
End With
Set setCnxn = Cnxn
End Function
Here are some other strings I've tried:
cnxnStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=filepath.accdb;"
cnxnStr = "Provider=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft Access
Driver (*.mdb, *.accdb)};DBQ=C:filepath.accdb;Persist Security Info=False;"
cnxnStr = "Driver={Microsoft Access Driver (*.mdb,
*.accdb)};DBQ=C:\Users\Summer\Desktop\PMOBlotterDB\PMOBlotter.accdb; Persist
Security Info=False;"
I've read the ConnectionString.com site and hat's where I got my one of the
strings but it doesn't work either.
I've gotten several different error messages for each of the strings I've
tried. With the current string i'm getting:
Run-time error '-2147467259 (80004005)':
[Microsoft][ODBC Driver Manager] Data source name too long.
Please Help