You are not logged in.
I hope someone can shed some light on this as it's driving me nuts. I'm opening an existing db file and attempting to get the table names like this.
Props := TSQLDBSQLite3ConnectionProperties.Create(dbFile,'','','');
Props.GetTableNames(tableRA);
I built a sample program to test with. Works fine. I'm using the same unit with this code in both an application and a service to open/access the db. It works fine in the service. In the application when I call the GetTableNames, I get a "database disk image is malformed" (error 11) in the sqlite3_prepare_v2 routine. I've double and triple (and ...) that the database name is correct (even copy/pasted from the working test program). Are there any known conflicts with any other libraries that I may be using or can anyone shed any insight on this?
I doubt it's relevant but I'm using Delphi 2010 on Win 7 64 for testing.
Offline
Never mind, figured it out. Windows (in it's supreme knowledge) had created a file in the VirtualStore directory. That is the db file that was being accessed. Deleted that file and all is ok now.
For any others that may run into this issue, I am writing my data to the commonappdata directory (C:\ProgramData on Win 7). Windows will redirect commonappdata to the C:\users\loggedinusername\AppData\Local\VirtualStore\ProgramData directory if the rights to the actual directory desired are not sufficient. Once the file is there, even if the actual directory rights are sufficient, Windows will still look in the virtual directory first for the file.
Offline