On Friday 14 April 2006 23:08, Jon Foster wrote:
> Are the SQL DB components supposed to be functional? I've tried using
> TMySQLConnection and TPQConnection with the associated TSQLTransaction
> and TSQLQuery attached through a datasource to a data grid.
>
> The TMySQLConnection always says, "Server connect failed" when I try to
> make a query active. When I set the connection's "Active" property to
> true in the designer everything is fine. The message only shows when I
> try to make a query, connected to the "active" connection, active.
>
> The TPQConnection almost works. It appeared I could add things by
> entering data in the columns and tabbing down. Then when I tried to move
> back up a row it dies with an "access violation". None of the records I
> entered ever hit the database.
>
> I've updated my Lazarus install via SVN today. The problems persist. I
> really would like to ditch Kylix/Delphi but I need functional DB access
> to either MySQL or PostgreSQL. I would prefer MySQL. Are there other
> components that would allow me to create data driven applications?
>
> THX - Jon
Yes it works.
First I suggest that you look at the FPC examples for how you should program
the SQLdb. You will notice that the components require a set order and
setup. Since all my programs require a login screen I set the required
fields in the "OnCreate" method of the form.
with pqconnection1 do
begin
UserName:=dbuser;
password:=dbpassword;
hostname:=dbserver;
databasename:=dbname;
connected:=True;
end;
Then you have to set the other controls as required. I have a some what long
blog "adventures of a newbie" on the wiki that might be of more help. Also
there is a MySQL tutorial.
John
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives