Read mailbox users from unmounted exchange database file using ESE API
Hi,
I'm trying to read the mailbox users from an unmounted exchange database using ese api.
Below is the code snippet,
#undef JET_VERSION
#define JET_VERSION 0x0501
#include "Esent.h"
int _tmain(int argc, _TCHAR* argv[])
{
JET_INSTANCE instance;
JET_ERR error;
JET_SESID sesid;
JET_PCSTR szFilename = "E:\\EXCHANGE\\FSG\\Mailbox Database.edb";
JET_DBID dbid;
JET_API_PTR value;
char szbuff[1024] = {0};
error = JetSetSystemParameter(&instance, JET_sesidNil,JET_paramDatabasePageSize, 4096, NULL);
error = JetCreateInstance(&instance,"instance");
error = JetSetSystemParameter(&instance, JET_sesidNil, JET_paramLogFilePath, NULL, "F:\\EXCHANGE\\FSGLOG\\");
error = JetGetSystemParameter(instance, JET_sesidNil, JET_paramDatabasePageSize, &value, szbuff, 1024);
cout<<"\nJetGetSystemParameter value = "<<value;
error = JetInit(&instance);
error = JetBeginSession(instance, &sesid, NULL, NULL);
cout<<"\nJetBeginSession identifier = "<<sesid;
error = JetAttachDatabase(sesid, szFilename, JET_bitDbReadOnly);
cout<<"\nJetAttachDatabase = "<<error;
error = JetOpenDatabase(sesid, szFilename, NULL, &dbid, JET_bitDbReadOnly);
error = JetCloseDatabase(sesid, dbid, NULL);
error = JetDetachDatabase(sesid,szFilename);
error = JetEndSession(sesid, sesgrbit);
error = JetTerm(instance);
return 0;
}
Here, the api "JetAttachDatabase" always returns error code -1213
JET_errPageSizeMismatch
-1213
The database page size does not match the engine.
Can anyone explain why i'm getting this errror ? Should I need to change the JET_VERSION ?
Thanks,
Inmar
August 18th, 2010 9:29am
Hi Inmar,
For development issue, I suggest you to write the post in our development sub forum:
http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threads
Thanks,
Elvis
Free Windows Admin Tool Kit Click here and download it now
August 24th, 2010 11:40am
Hi Inmar,
For development issue, I suggest you to write the post in our development sub forum:
http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threads
Thanks,
Elvis
August 24th, 2010 11:40am
My guess is that because of the error you are getting you are trying to open an EDB with 4K page sizes with a version of the API which designed for 8K pages, or vice versa. Which version of Exchange created the EDB and which version of Windows are
you running?
Free Windows Admin Tool Kit Click here and download it now
September 24th, 2010 3:26pm