Welcome, Guest
Username: Password: Remember me
Components and Libraries for Database Development, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

Zeos and SQLite is broken in CT >= 2.8 11 years 7 months ago #2555

  • DL7BJ
  • DL7BJ's Avatar Topic Author
  • Visitor
  • Visitor
Hi,

I have using a VM with LMDE (Mint Linux Debian) 32 Bit, CT 2.4 as my
development machine until yet. No problems with that, the applications
runs fine with ZEOS and sqlite3.

With CT2.4, CT2.8 and CT.29 on LMDE 64 Bit I have problems.

CT2.4 - after installation CT starts, Lazarus IDE has only empty
windows, no icons, no menues and hangs.

CT2.8 - same application as above results in error "SQL logic error
or missing database".

CT2.9 - same as 2.8

The TZConnection is ok. If I set the first Query on Active, I get this
error. Same within the IDE.

I want to download 2.5, 2.6 and so on, but on that slowly download site
with banner ads the download is totally broken (got CodeTyphonIns_250.zip.html
with 3618 Bytes ???)

===== to be continued ...

It's late, but I have debugged it:

I wrote a litte test program. Only one Form (Form1), a DBGrid, DBNavigator,
ZConnection, ZMonitor, ZQuery and a DataSource. The database file is stored
as /tmp/database.db, so I set in the ObjectInspector ZConnection.Database to
this path.

The program does only that:

procedure TForm1.FormShow(Sender: TObject);
begin
ZConnection1.Connected := False;
ZConnection1.Database := '/tmp/database.db';
ZConnection1.Connected := True;
ZQuery1.Active := True;
end;

With the debugger I found that the error is a result of line 178
in ZDbcSqLiteStatement.pas :

ErrorCode := FPlainDriver.Compile(FHandle, PAnsiChar(SQL), Length(SQL), SQLTail,
StmtHandle, ErrorMessage);

This is a call to the sqlite_prepare statement. Okay, this could not be, that there
is in error code of 1 as result. The query is only a 'SELECT * FROM "CONFIG"', the
database is connected. This is not wrong!

I saw in my project directory a database.db with 0 Bytes. I have using sqlite3
a long time with FLTK and C/C++ and know, when I call the sqlite_open and there is
no database file, sqlite will create an empty file. This is happend!
But why? The property database of ZConnection has the value '/tmp/database.db'.

The monitor log says this:

2012-09-27 00:26:56 cat: Connect, proto: sqlite-3, msg: CONNECT TO "database.db" AS USER ""
2012-09-27 00:26:56 cat: Execute, proto: sqlite-3, msg: SELECT * FROM "CONFIG"
, errcode: 1, error: SQL logic error or missing database

If I copy the database.db in the same directory as my program, than I got no error.

But, how could I use another directory for the database files?

Regards,
Tom

Please Log in or Create an account to join the conversation.

Last edit: by DL7BJ.
  • Page:
  • 1