Hi Thaddy,
I tried a simple example and quess what IT FAILED!!
program sqlite_test;
{$mode objfpc}{$H+}{$ifdef mswindows}{$apptype console}{$endif}
{$apptype console}
uses SysUtils, sqldb, sqlite3conn;
var
Conn: TSQLite3Connection;
Query: TSQLQuery;
Id:integer;
TextField:string;
begin
Conn:=TSQLite3Connection.Create(nil);
Conn.DatabaseName:='SQlite.gbl.twm';
Conn.Connected:=True;
Query:=TSQLQuery.Create(nil);
Query.Database := Conn;
Query.SQL.Text := 'SELECT topic_id, data FROM content WHERE topic_id = :id';
Id:=2;
Query.ParamByName('Id').AsInteger := Id;
Query.Open;
TextField := Query.FieldByName('data').AsString;
Writeln('The value of TextField is: ', TextField);
// Change the value of TextField
Query.Edit;
Query.FieldByName('data').AsString := 'Hierdie is my beste poging...';
// Commit the change
Query.Post;
Query.ApplyUpdates;
Query.Free;
Conn.Free;
end.
It fails on:
An unhandled exception occurred at $00000000:
EAccessViolation: Access violation
$00000000
$0044651B
$004475A0
Now that is really a good explanation of what went wrong! Can you explain it in plain English?
My Table on the db is defined as follows:
CREATE TABLE content(topic_id integer primary key, data BLOB)