Connecting Tech Pros Worldwide Help | Site Map

Accessing unmounted priv1.edb file using ESE API (Exchange Server 2003)

Newbie
 
Join Date: Jul 2009
Posts: 4
#1: Aug 8 '09
Hi,

I am looking for mapping between the MailBox Table and its respective folders which are represented as Folder Table in the ESE database.

As the MailBox table gives us the list of all the mailboxes stored in the EDB file which is basically unmounted. Through dumping the EDB file using the ESENTUTL.exe tool i got the list of all the folders and the mailboxes with the Index pages.

Through this i am able to map the Folder tables like Inbox, Contacts etc with their parentIPM Store Table and their respective MailBox Table name.

As i list the tables in the EDB file using the ESE API, i got all the tables but i dint found the MailBox table name which is basically an integer value (some what : 0001- 00000001798)

But i am able to fetch and open the IPMStore Table and all the folders inside it. As the Folder Table names are also in the Integer type.

Now i am looking to map these tables such that after fetching the MailBox table which stores all the list of mailboxes. After opening this table i am looking to get the Folder Table names by which i will be able to get the messages for the inbox, outbox, contacts etc folders of that particular mailbox.

Is there any comman column in these table by which i can map the mail box table with thier related folder tables ?

Kindly help me out, as i dint got any information regarding the Mapping of the Folder Tables and the mailbox table.

Thanks in advance......
Newbie
 
Join Date: Aug 2009
Posts: 1
#2: Aug 18 '09

re: Accessing unmounted priv1.edb file using ESE API (Exchange Server 2003)


Hi Anup,

I am trying to read a edb file using ESE APIs and am facing the problem of not
being able to read any of the tables, here is my code, please tell me where i
have gone wrong.

/************************************************** ***********************************/
// One possible error-handling strategy is to jump to an error-handling
// label whenever an ESENT call fails.
#define Call(func) { \
err = (func); \
if(err < JET_errSuccess) { \
goto HandleError; \
} \
}\
{
JET_ERR err = JET_bitNil;
JET_INSTANCE instance = JET_bitNil;
JET_SESID sesid = JET_bitNil;
JET_DBID dbid = JET_bitNil;
JET_TABLEID tableid = {1};

JET_COLUMNDEF columndef = {0};
JET_COLUMNID columnid = {0};

Call(JetCreateInstance2(&instance, "instance",NULL,JET_bitNil));
Call(JetInit(&instance));
Call(JetBeginSession(instance, &sesid, 0, 0));

Call(JetAttachDatabase2(sesid,"tmp.edb",NULL,JET_b itDbReadOnly ));

char buffer[1024];
Call(JetGetDatabaseInfo(sesid,dbid,buffer,sizeof(b uffer),JET_DbInfoFilename));
MessageBoxA(NULL,buffer,NULL,MB_OK);
memset(buffer,NULL,sizeof(buffer));

Call(JetGetTableInfo(sesid,tableid,buffer,sizeof(b uffer),JET_TblInfoName));

JetDetachDatabase(sesid,"tmp.edb");
JetEndSession(sesid, 0);
JetTerm(instance);
return 0;

HandleError:
if(err == JET_errInvalidDatabase)
{
MessageBox(NULL,_T("Invalid Database"),NULL,MB_OK);
}
else
{
printf("ESENT error %d\n", err);
}
return 1;
}
/************************************************** ***********************************/
Regards
Subramanya M.S
Newbie
 
Join Date: Jul 2009
Posts: 4
#3: Aug 18 '09

re: Accessing unmounted priv1.edb file using ESE API (Exchange Server 2003)


Try passing the table name as MsysObjects, which basically contains the name of all the tables.
Reply