Hi...

I have tried to access 'Contacts Database' that is under '\\database'
folder.

I don't want to use POOM.

so I used RAPI and I could access general database as *.cdb under other
folers.

but I can't access DB which are in '\\database' folder.

I wonder what is different between general db and 'Contacts Database'

Firstly, I had tried to mount 'Contacts Database' but I couldn't mount db.

what's wrong with code..?

===============================================================
RAPIINIT ri;
ri.cbSize = sizeof(ri);
hRapiResult = CeRapiInitEx(&ri);

if (FAILED(hRapiResult))
{
return FALSE;
}

strDbName = "\\Databases\\Contacts Database";

MultiByteToWideChar(CP_ACP,
0,
strDbName,
strlen(strDbName)+1,
(LPWSTR)&wDBname,
sizeof(wDBname));

pceguid = (PCEGUID)LocalAlloc(LPTR, sizeof(CEGUID));
lpBuf = (LPWSTR) LocalAlloc (LPTR, MAX_PATH);

if (!CeMountDBVol (pceguid, // Pointer to a CEGUID.
wDBname, // Database-volume name.
OPEN_EXISTING))
{
........................
}

===============================================================

your earliest reply will be appreciated!

thanks.

Re: How can I use Contacts Database with RAPI by Nav

Nav
Thu Jun 17 14:40:32 CDT 2004

Looks like you're trying to access the "Contacts Database" inside the object
store, and thus you shouldn't call CeMountDBVol.

Just use CREATE_INVALIDGUID to get the guid to be passed into
CeOpenDatabaseEx as stated in the CeOpenDatabaseEx documentation for opening
object store databases below:

pceguid
[in] Pointer to the CEGUID that contains the globally unique identifier of a
mounted database. If pceguid equals CREATE_INVALIDGUID, then poid is
ignored, and the object store and all mounted databases are searched for a
database whose name matches lpszName. The search is completed when the first
match is located.

--
Nav Mehta [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.

"nurgoori" <nurgoori@free-ism.com> wrote in message
news:eclDuMIVEHA.2908@TK2MSFTNGP10.phx.gbl...
> Hi...
>
> I have tried to access 'Contacts Database' that is under '\\database'
> folder.
>
> I don't want to use POOM.
>
> so I used RAPI and I could access general database as *.cdb under other
> folers.
>
> but I can't access DB which are in '\\database' folder.
>
> I wonder what is different between general db and 'Contacts Database'
>
> Firstly, I had tried to mount 'Contacts Database' but I couldn't mount db.
>
> what's wrong with code..?
>
> ===============================================================
> RAPIINIT ri;
> ri.cbSize = sizeof(ri);
> hRapiResult = CeRapiInitEx(&ri);
>
> if (FAILED(hRapiResult))
> {
> return FALSE;
> }
>
> strDbName = "\\Databases\\Contacts Database";
>
> MultiByteToWideChar(CP_ACP,
> 0,
> strDbName,
> strlen(strDbName)+1,
> (LPWSTR)&wDBname,
> sizeof(wDBname));
>
> pceguid = (PCEGUID)LocalAlloc(LPTR, sizeof(CEGUID));
> lpBuf = (LPWSTR) LocalAlloc (LPTR, MAX_PATH);
>
> if (!CeMountDBVol (pceguid, // Pointer to a CEGUID.
> wDBname, // Database-volume name.
> OPEN_EXISTING))
> {
> ........................
> }
>
> ===============================================================
>
> your earliest reply will be appreciated!
>
> thanks.
>
>