|
Question : Simple ADODB Connection Error
|
|
I am trying to make a test ADO connection in a simple Access 2003 DB. This is what I have written (I've got nothing else yet, just trying the connection itself):
Dim cn As ADODB.Connection Set cn = New ADODB.Connection With cn .ConnectionString = CurrentProject.Connection .CursorLocation = adUseClient .Attributes = .Attributes Or adXactCommitRetaining .Open End With
This code is activated by the Click event of a button. When I click the button, I get the following error: "Run-time error '-2147467259(80004005)': Could not use "; file already in use."
Extra Info: In the Immediate Window, my CurrentProject.Connection string = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\PMA 202\db1.mdb;Mode=Share Deny Read|Share Deny Write;Extended Properties="";Jet OLEDB:System database=C:\Documents and Settings\cmyers.ATO10\Application Data\Microsoft\Access\System.mdw;Jet OLEDB:Registry Path=Software\Microsoft\Office\11.0\Access\Jet\4.0;Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"
Also, the DB is not Read Only, is opened in Share, etc. This should be a very simple connection test, but I can't figure out what's gone wrong. Thanks. (Also, any instructions on what level of points this might be worth would be cool, this is my first time using this forum.)
|
|
Answer : Simple ADODB Connection Error
|
|
Actually I think this might work better:
Dim cn As Object cn = CurrentProject.Connection With cn .CursorLocation = adUseClient .Attributes = .Attributes Or adXactCommitRetaining End With
|
|
|
|