Hello, I was having a bit of trouble connecting to an access 2007 database. Before I get into the details, I'll give you a little background. I had a tool running off of Word in the old .doc format, and the code originally connected to an older access 97 database with the old mdb format. The connection code looked like so:
Set gobjConn = CreateObject("ADODB.Connection")
With gobjConn
.ConnectionString = "Driver=Microsoft Access Driver (*.mdb);DBQ=" & Application.ActiveDocument.Path & "\Triage.mdb;UID=Admin;PWD=;"
.Open
End With
The business was upgrading to Access 2007 so after converting the backend to accdb format I changed the code like so:
Set gobjConn = CreateObject("ADODB.Connection")
With gobjConn
.ConnectionString = "Driver=Microsoft Access Driver (*.accdb);DBQ=" & Application.ActiveDocument.Path & "\Triage.accdb;UID=Admin;PWD=;"
.Open
End With
However, this game the error message:
I thought it might have been because I was running the application in the older .doc format, so I converted it to .docm and tried again but it resulted in the same error message. Before anybody asks, yes the database exists on the specified path
Any ideas?
Set gobjConn = CreateObject("ADODB.Connection")
With gobjConn
.ConnectionString = "Driver=Microsoft Access Driver (*.mdb);DBQ=" & Application.ActiveDocument.Path & "\Triage.mdb;UID=Admin;PWD=;"
.Open
End With
The business was upgrading to Access 2007 so after converting the backend to accdb format I changed the code like so:
Set gobjConn = CreateObject("ADODB.Connection")
With gobjConn
.ConnectionString = "Driver=Microsoft Access Driver (*.accdb);DBQ=" & Application.ActiveDocument.Path & "\Triage.accdb;UID=Admin;PWD=;"
.Open
End With
However, this game the error message:
[Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified
I thought it might have been because I was running the application in the older .doc format, so I converted it to .docm and tried again but it resulted in the same error message. Before anybody asks, yes the database exists on the specified path
Any ideas?