in

System.Data.SQLite

An open-source, enhanced version of the SQLite database engine for Windows

database can't be read in third party clients!

Last post 03-02-2006 4:08 PM by Robert Simpson. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 01-11-2006 9:15 AM

    database can't be read in third party clients!

    I generated a sqlite database file and created a table using this wrapper but when I tried to open it using another sqlite client, it shows nothing. There is no table there. Is it a bug or something else?
  • 01-11-2006 10:00 AM In reply to

    Re: database can't be read in third party clients!

    What version of the SQLite wrapper were you using?  If the "other client" you speak of uses the native sqlite3.dll, what version of that DLL are you using?

    Robert

     

  • 01-11-2006 10:08 AM In reply to

    Re: database can't be read in third party clients!

    I am using Version 1.0.24.3
    the clients I used are SQLite Spy, SQLite Database Browser and SQLiteManager (demo version online). All of them are the latest version. I don't know whether they come with the library bundled or not. I myself download sqlite-3.3 beta
  • 01-11-2006 10:18 AM In reply to

    Re: database can't be read in third party clients!

    According to the release notes for SQLite 3.3.0 (available on sqlite.org's front page) :

    The file format for version 3.3.0 has changed slightly in order provide a more efficient encoding of binary values. SQLite 3.3.0 will read and write legacy databases created with any prior version of SQLite 3. But databases created by version 3.3.0 will not be readable or writable by earlier versions of the SQLite. The older file format can be specified at compile-time for those rare cases where it is needed

    It looks like your 3rd party utilities are either using an older sqlite3.dll or are statically compiled against an older version of the library.

    Robert

     

  • 01-11-2006 8:47 PM In reply to

    Re: database can't be read in third party clients!

    I see... no wonder I can't view it... Thanks!
    BTW, is there any third party client compiled with version 3.3?
    I need them to check if my code works properly...
  • 01-11-2006 10:29 PM In reply to

    Re: database can't be read in third party clients!

    Most 3rd party viewers use a dynamic link to sqlite3.dll.  Just replace sqlite3.dll with the newest alpha version.  Do a search on your computer for sqlite3.dll and make sure you either delete or replace them with the alpha from sqlite.org's website.

    Robert

     

  • 03-02-2006 3:41 PM In reply to

    Re: database can't be read in third party clients!

    What are my options if I need to create databases that are compatible with a third party application that uses an earlier version of Sqlite 3?

    Richard

  • 03-02-2006 4:08 PM In reply to

    Re: database can't be read in third party clients!

    Most 3rd party applications use the sqlite3.dll file, which you can easily just replace.  As a matter of fact, you can make a copy of System.Data.SQLite.DLL and rename it to "sqlite3.dll" and all those 3rd party utilities that use the sqlite3.dll will run against it just fine.

    If you need to create a database using an older file format, you can use the legacy_file_format pragma after opening the connection.  To do it, just do this right after opening the connection:

    using (SQLiteCommand cmd = new SQLiteCommand("PRAGMA legacy_file_format=1", connection))
    {
      cmd.ExecuteNonQuery();
    }

    This will make SQLite use the 3.0.0 file format which will be upward compatible with all newer 3.x libraries.  Here's a list of the versions that have caused a change to the file format:

    ** file_format==1 Version 3.0.0.
    ** file_format==2 Version 3.1.3. // ALTER TABLE ADD COLUMN
    ** file_format==3 Version 3.1.4. // ditto but with non-NULL defaults
    ** file_format==4 Version 3.3.0. // DESC indices. Boolean constants

    Robert

     

Page 1 of 1 (8 items)
Powered by Community Server (Commercial Edition), by Telligent Systems