Dennis Cote wrote:
Taj Morton wrote:http://www.torry.net/db/direct/db_directsql/sqlitedb.zip should work. Sorry about that.
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.
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).
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.// 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;
Thanks! -- Taj