I am trying to read into some existing and unmounted esent database files (like Windows.edb). I have been playing around with some edb files rather successfully. But when I try to open a database with PageSize that is not equal 8192 I get an error.
Here's my code (without error-handling):
FError := JetSetSystemParameter(@FInstance, nil, JET_paramDatabasePageSize, FPagesize, nil);
FError := JetCreateInstance(@FInstance, 'EDBInstance');
FError := JetInit(@FInstance);
FError := JetBeginSession(FInstance, @FSessionId, nil, nil);
FError := JetAttachDatabase(FSessionId, FFilename, JET_bitDbReadOnly);
It works fine as long as FPageSize = 8192. Any other value (4096, 32768) fails at the JetInit call which returns an -1213 code. If I don't set the proper PageSize value for the database I get the same error at JetAttachDatabase, which I can understand. But the first error that gets returned by JetInit I fail to comprehend. What do I do wrong? I hope Laurion Burchall is reading this! :-)
I am running a Windows 7 64bit.
There are two possibilities:
If you want to open an existing database in a read only way then you should turn recovery off (set JET_paramRecovery to "off"). That will prevent any logfiles from being generated which will avoid a lot of problems.