开发者

MFC application: Embedded batabse on windows mobile 6 SDK return with an error while writing to DB

开发者 https://www.devze.com 2023-01-10 00:54 出处:网络
I am implementing a database on wince platform in EDB. I have created and successfully tested all database operations in MFC simple dummy database application.

I am implementing a database on wince platform in EDB. I have created and successfully tested all database operations in MFC simple dummy database application. But when I have integrated database API into my project it create problem.

Scenario:

I am able to create database using CeMountDBVol(...) API with EDB flag on.

A table is created into the mounted volume (volume is a database in EDB world) by CeCreateDatabaseWithProps(...) API.

API CeOpenDatabaseInSession(...) opens the database successfully.

I nee开发者_JS百科d to call open database call two times from different functions. 1st time after creation of database and 2nd time before writing to database.

Now when I am call API CeWriteRecordProps(...) to write record to database it return with any error code 32 which means "The process cannot access the file because it is being used by another process.".

Here I am not getting which process it is trying to access. Your help will be appreciated.

This is my first questing, please forgive me if question forming is wrong.


Sorted out the problem :)

It was failing because of twice the calls for open database. EDB does not give close database call. My code is trying to open the table(EDB calls it as database) which is already opened. I removed the 2nd open database call and it returns success.

Thank you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号