[Lazarus] Postgres database again...

Graeme Geldenhuys graemeg.lists at gmail.com
Tue May 27 12:43:59 CEST 2008


Dave Coventry wrote:
> Okay, just supposing that I have the SQL Queries working ok, how do I
> access the fields from inside Lazarus?
> 
> If I query using "SELECT * FROM registration", where do the resultant
> fields end up?
> 
> Or perhaps I was on the right track and they ARE accessible from
> SQLQuery1.Fields[i].AsString?


Here are step-by-step instructions in using Databases with Lazarus 
(normal Delphi style).

http://z505.com/cgi-bin/powtils/docs/1.6/idx.cgi?file=fcldbnotes
http://z505.com/cgi-bin/powtils/docs/1.6/idx.cgi?file=index&unit=sqldb


A quick search on the Lazarus wiki found the following. I think they 
might be handy as well.

http://wiki.lazarus.freepascal.org/Contacts_Database
http://wiki.lazarus.freepascal.org/Databases
http://wiki.lazarus.freepascal.org/Databases_in_Lazarus


Here is a post I found in the lazarus mailing list. There are many more.


------------[ copy ]----------------
On Mon, 4 Feb 2008, el stamatakos wrote:

 > >
 > > Hi,
 > >  I am working with a database and I am doing the following
 > >
 > > tFile:string;
 > >
 > > tFileName:=mainForm.SQLQuery1.FieldValues['tFileName'];

You should never use FieldValues, this is a horrible construct which Delphi
introduced for Visual Basic  "compatibility".

You should use
   tFileName:=mainForm.SQLQuery1.FieldByName('TFileName').AsString;
instead.

Michael.
------------[ end ]----------------


Regards,
   - Graeme -


_______________________________________________________
fpGUI - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/





More information about the Lazarus mailing list