Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm writing a program to read edb file in c++
I've tried with esent windows library and I got "The database page size does not match the engine" error on "JetAttachDatabase"

And i also tried "libesedb" library, but i can't understand how to use it.

Is there any other way to read edb in c++ or how can I fix errors

What I have tried:

err = ::JetInit(0);
if(JET_errSuccess != err) return err;

JET_SESID sessionID = JET_sesidNil;
err = ::JetBeginSessionA(0, &sessionID, 0, 0);
	
if(JET_errSuccess != err) {
  ::JetTerm(0);
  return err;
}
	
err = JetAttachDatabase(
  sessionID,
  "1.edb",
  0
); // error -1213 "The database page size does not match the engine"
Posted
Updated 9-Aug-20 18:16pm
v2

1 solution

There's a discussion here on SO that *may* help (as much as I hate to point someone in that nest-of-vipers direction) edb - Esent database engine limited to specific page sizes? - Stack Overflow[^]
 
Share this answer
 
Comments
Member 14573258 10-Aug-20 1:09am    
Thanks
Is there any example?
Garth J Lancaster 10-Aug-20 2:20am    
It's *really* hard to find information out there ... it looks like you would do something like this
JET_INSTANCE instance;
JetCreateInstance(&instance, "instance"));

JetSetSystemParameter (&instance,
                               JET_sesidNil,
                               JET_paramRecovery,
                               NULL,
                               (JET_PCWSTR)"Off”);
and that means your line
err = ::JetInit(0);
becomes
err = ::JetInit(&instance);


These are the references I found
https://docs.microsoft.com/en-us/windows/win32/extensible-storage-engine/extensible-storage-engine
https://stackoverflow.com/questions/56278300/why-does-jetattachdatabase-return-error-550
https://stackoverrun.com/ru/q/8475032
Garth J Lancaster 10-Aug-20 2:22am    
This article here may also help in general terms https://www.codeproject.com/Articles/52715/Extensible-Storage-Engine

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900