Hi,
I am trying to use sqlite package to connect to a sqlite database and
create a simple gui that interacts with it.
I followed the steps on the tutorial and created a sqlite database file
rightclicking the TSqliteDataset component. I also added some data to
the database using the command line tool that comes with sqlite.
Now I have 5 components on my form: SqliteDataset, a Datasource, a
DBGrid, DBNavigator and a DBEdit.
First problem: I connected the datasource to the dataset, and the DB
components to the datasource, but when I try to se a field for the
DBEdit I see no fields available to select. If I just type the field
name by hand it will give me a "Field not Found". I tryed to connect the
field coding something like:
DBEdit.Field.Assign(SqliteDataset.FieldByName('Nome')); but this didn't
work.
Second problem: On the DBGrid I can see the dummy data I entered, but if
I try to write new data, as soon as I leave the newly created record it
vanishes! It will only write if I click the Post button on the
DBNavigator. Is there a way to make it always write?
I am opening and closing the dataset on OnCreate and OnDestroy, because
I cannot find out how to activate the dataset at design-time to select
the fields:
procedure TjanelaPrincipal.FormCreate(Sender: TObject);
begin
SqliteDataset.Open;
// DBNome.Field.Assign(SqliteDataset.FieldByName('Nome'));
end;
procedure TjanelaPrincipal.FormDestroy(Sender: TObject);
begin
SqliteDataset.Close;
end;
I am using Mandriva Linux 2005, the latest Lazarus (svn) and my sqlite
package is: libsqlite0-2.8.16-1mdk
thanks,
Felipe
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives