Access Violation using MSAccess 2007 Database File
Posted: Mon 28 Sep 2009 19:02
When I try to connect to an Access 2007 (accdb) database file I get an the error message.
[Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt. EUniError
The code to recreate this is simply:
...
UniConnection1.ProviderName:= 'ACCESS';
UniConnection1.Database:= ExtractFilePath(Application.ExeName)+'database2.accdb';
try
UniConnection1.Connect;
except
on e:exception do
ShowMessage(e.Message+' '+e.ClassName);
end;
...
The database2.accdb file has a single table with just a few records.
[Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt. EUniError
The code to recreate this is simply:
...
UniConnection1.ProviderName:= 'ACCESS';
UniConnection1.Database:= ExtractFilePath(Application.ExeName)+'database2.accdb';
try
UniConnection1.Connect;
except
on e:exception do
ShowMessage(e.Message+' '+e.ClassName);
end;
...
The database2.accdb file has a single table with just a few records.