Dennis Cote wrote:

Taj Morton wrote:


Dennis,

Indeed. Actually, I'm using an OO wrapper around that library,
TSQLiteDB
(http://homepages.borland.com/torry/db/direct/db_directsql/tsqlite.zip).



This link gives me a 404 error so I can't look at the code myself.


http://www.torry.net/db/direct/db_directsql/sqlitedb.zip should work. Sorry about that.

What do DB.Open and DB.Close do? I think maybe they should surround the
other code as well, like this:


procedure TSQLiteDB.Open;
begin
 if FSQL <> '' then
 begin
   FDb.Query(FSQL, FData);
   CreateFields;
 end;  // if
 FBof := True;
 FEof := False;
 FRecordCount := FData.Count;
 if FRecordCount > 0 then
   FCurRec := 1
 else
   Exit;

 RemoveQuotation;
 RetrieveRecord;
 FActive := True;
 FFieldCount := FFields.Count;
end;

procedure TSQLiteDB.Close;
begin
FData.Clear;
FFields.Clear;
FCurRec := -1; FRecordCount := 0;
FBof := True;
FEof := True;
FActive := False;
end;


So, no destruction is being done of the FDB object (that's done in TSQLiteDB.Free).

 // DB is a TSQLiteDB created on FormCreate
 DB.Open;
 DB.SQL:='CREATE TEMPORARY TABLE cname2cid(cid INTEGER,name
VARCHAR(512));';
 DB.ExecSQL;

DB.SQL:='SELECT id,firstname,lastname,business from customers;';
//...
DB.Close;


No go :(. I used breakpoints and checked right after the first DB.ExecSQL, then looked at .tables from sqlite.exe...it didn't show up their either.

Thanks!
--
Taj



Reply via email to