Log in

View Full Version : Deleting an object store table


cesarfong
08-14-2003, 03:30 PM
hi i am developing an ATL for being consumed by an evb app. So this method "DropTable" only works when I don´t have use the object store just before.

But when i am calling apis i.e. CeReadRecordPropsEx or CeSeekDatabase before using this method... it didn't eliminate the table!!!

any help???

STDMETHODIMP CAccesoOS::EliminarTabla(BSTR Nombre)
{
#ifdef UNDER_CE

CEOID CeOid=0;
HANDLE tHandle;

tHandle=CeOpenDatabase(&CeOid,Nombre,0,0,NULL);


CloseHandle(tHandle);
CeDeleteDatabase(CeOid);



#endif

return S_OK;
}

i have found that after CeDeleteDatabase(CeOid); it returns me ERROR_SHARING_VIOLATION when i have used the database.. and 0 (it delete) when i call this function after all.

any idea how to avoid ERROR_SHARING_VIOLATION, cause CloseHandle doesn´t work

Thx in advanced

César


http://www.pocketpcdn.com/forum/viewtopic.php?p=2157#2157

Peter Foot
08-20-2003, 10:35 PM
Just a thought, have you tried inserting a CeFlushDBVol call after closing your database and before calling delete?

Peter

cesarfong
08-20-2003, 10:40 PM
thanks peter for your advice i will try tonight.. :) and i tell you