Ha! This made the trick. I tried only with FILE_SHARE_READ and this didn't work, but I didn't try with both of them.
Thanks a lot! Ran On 6/21/06, Igor Tandetnik <[EMAIL PROTECTED]> wrote:
Ran <[EMAIL PROTECTED]> wrote: > Thanks for your reply. I know that I should lock the file before > copying it, > and the "BEGIN IMMEDIATE" is indeed a nice trick. > However, I think I didn't explain my problem clearly. I would like to > copy > that file _without_ using the sqlite library (so using the windows API > only). > > When I try to do that with: > CreateFile(db_file, > GENERIC_READ, > 0, > NULL, > OPEN_EXISTING, > FILE_ATTRIBUTE_NORMAL, NULL); > > I get error 0x20 - "the process cannot access the file becuase it is > beging > used by other process". You want to enable sharing. Pass FILE_SHARE_READ | FILE_SHARE_WRITE as the third parameter. Igor Tandetnik