I think this is a different question, unrelated to the previous sqlite_open thread.

I'm in a WIN32 environment.  I'm using:
h = CreateFile(path, GENERIC_READ, FILE_SHARE_READ || FILE_SHARED_WRITE,
             NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
to establish if my DB exists before I open it. If it does exist, I close the handle "h" immediately. I then call sqlite3_open. If the file did not previously exists, I then create my tables.

I have multiple processes accessing the resulting DB. One of those processes only queries the DB. I call:
  h = CreateFile(path, GENERIC_READ,  FILE_SHARE_READ,
             NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
to verify the file exists before declaring an error if it does not exists. The problem is that CreateFile is returning error in this case and GetLastError() tells me that "The process cannot access the file because it is being used by another process." Is there any reason that the second CreateFile above would be incompatible with whatever SQLite uses to open the file?

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to