I am trying to create a console app which connects to a sqlite3 database. But I seem to be doing something wrong. Any Ideas?
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls,ZConnection, ZDataset ;
begin
conn := TZConnection.Create(nil);
query := TZQuery.Create(nil);
query.Connection := conn;
try
try
conn.Protocol := 'sqlite-3';
conn.HostName := '';
conn.Database := 'collex.sdb';
conn.User := '';
conn.Password := '';
conn.Connect;
query.Active:= true;
query.SQL.Clear;
query.SQL.Text := 'SELECT * from sys_val limit 0,1';
query.Open;
query.Last;
CcLicense := query.FieldByName('cc_license').AsString
finally
query.Close;
conn.Free;
end;
except
on E: Exception do
WriteLn(E.message);
end;
end;
I get the error project1.lpr(1,1) Fatal: Can't find unit ZConnection used by Project1
even though I have installed the zeos package in lazarus.