Topic: TSQLitePassDatabase.Connected bug

Hi,

Using Delphi 2010 and SQLitePass 0.50. This is what I do:

- Start Delphi 2010 en reopen my test project containing TSQLitePassDatabase and TSQLitePassDataset (Properties of TSQLiteDatabase are already set).
- Double Click on Connected property of the TSQLItePassDatabase
- Very often the state doesn't change from False to True.
- If it doesn't change then the set the Database property of TSQLiteDatabase again (to the same value).
- Now the state changes if I double click on the Connected property of TSQLiteDatabase.

Best Regards,
Pascal

Re: TSQLitePassDatabase.Connected bug

Hi Pascal,

I didn't do too much testing with D2010 (lack of time).

I tried to follow your instructions but could't get the bug to occur.

Do you have special chars in your database path ?

Could you send you sample db by mail ?

Thanks.

Re: TSQLitePassDatabase.Connected bug

hi Pascal,..
thanks for this nice informative post,...

Re: TSQLitePassDatabase.Connected bug

I have a SIMILAR PROBLEM WITH LINUX AND LAZARUS 0.9.29 FPC 2.5.1, I place a database component on the form and set the database, which I created with sqlite administrator, set the library file path which on my system is /usr/lib/libsqlite3.so try to set the connected property and it doesn't change, I try to set the property programatically and get the same result.

Re: TSQLitePassDatabase.Connected bug

Oh sqldbo 0.55

Re: TSQLitePassDatabase.Connected bug

Hi Dave,

Do you have the same problem on Windows ?

If not, first, at designtime, try to connect your DB, then Right Click on SqlitePassDatabase Component. Select "Show Log Error Dialog" in the menu. Move backward (lef arrow) and check the msg list.

You should find a message describing the problem. I guess one sqlite library function is missing. I bet on :

sqlite3_libversion_number, sqlite3_sourceid or sqlite3_compileoption_used ...

Some Linux distribution doesn't have the latest SQLlite library and doesn't always export the above function(s).

If my guess is correct, you have two solutions :

1 - Comment this function in source code in SqlitePassEngine.inc lines 362 +

@SqliteDbv3_SqliteLibVersionNumber := LoadFunction('sqlite3_libversion_number');
@SqliteDbv3_SqliteLibSourceId    := LoadFunction('sqlite3_sourceid');
@SqliteDbv3_compileoption_used   := LoadFunction('sqlite3_compileoption_used');

then rebuild the package

2 - Or install an updated sqlite library that exports the required functions.


Let me know about this quick fix.
Regards

Luc

Re: TSQLitePassDatabase.Connected bug

Thanks Luc, I no longer use windows, the error dialg came up when trying to run the test program, but I have forgotten what it said, will try what you suggest and get back to you.

Re: TSQLitePassDatabase.Connected bug

Hi Luc,
I have compiled the new sqlite3 library (tried commenting out as you suggested), you were right in your assumption that the error messge would be what you said. After compiling new sqlite3 library, I tried connecting and got an error, when I checked the error message it was saying it couldn't open the database, I generally use a generic sqlite manager where the the extension can be whatever you wish, I usually use .db3, which with your component is sqlite3 expert, so I downloaded your administrator program and constructed a sample db with the .s3db extension and this is the db that won't open. Any help would be appreciated.

Re: TSQLitePassDatabase.Connected bug

This is the error message that I'm getting when trying to connect: A TSqlitePassDatabase component has raised an exception.

TSqlitePassDatabase.Open : Unable to open the database.

Re: TSQLitePassDatabase.Connected bug

Hi Dave,

Do you have another msg when you step backward in the error dialog ?

If not, you can always build the packages with debug options on (remove the existing packages, re-open the packages and turn on the compiler debug infos options, then build) and step throught the code.

If it doesn't work for you, feel free to send your sample db. I'll have a look.

Regards. Luc

Re: TSQLitePassDatabase.Connected bug

Hi Luc,
I have done what you suggested and the test program works, thank you for your help.

Regards
Dave