Lazarus

Programming => Databases => Topic started by: mrdebug on October 16, 2007, 02:16:06 pm

Title: SqlitePass without DataAware component
Post by: mrdebug on October 16, 2007, 02:16:06 pm
Have you got an example of SqlitePass database without DataAware Component?
Title: RE: SqlitePass without DataAware component
Post by: Luc on October 20, 2007, 11:35:11 pm
- Drop a SqlitePassDatabase and a SqlitePassDataset on your form (named SqlitePassDatabase1 and SqlitePassDataset1).
 - Connect SqlitePassDatabase1 to a db (tested with a kexi db in  /demo/database). Connected := True
 - Connect SqlitePassDataset1 to SqlitePassDatabase1.
 - Select a table, query or enter your select sql statement
 - Set SqlitePassDataset1.Active := True;
 - Drop, for example, a memo + a button on your form and assign the button.onclick event.
   
   procedure TForm1.Button1Click(Sender: TObject);
   begin
   SqlitePassDataset1.Next;
   Memo1.Lines.Add(SqlitePassDataset1.Fields.FieldByName('Name').AsString);
   end;

This will display the value of the field 'Name' every time you click the button.

This is just a quick/dirty example. Let me know if you need to achieve a specific task.

Regards.

Luc.
TinyPortal © 2005-2018