[Gambas-user] Newbie problem connecting to MySQL
Kari Laine
kari.laine at ...1400...
Thu Mar 13 12:22:31 CET 2008
Mike Brett kirjoitti:
> I'm literally just starting with Gambas and would appreciate guidance
> please.
>
> Context : Latest compiled version (1.0.19), yum'd onto Fedora 8
>
> Aim: test project to create a connection to a localhost MySQL server
>
> Code as follows:
> MODMain module (this is set as start up class)....
> PUBLIC $Con AS NEW Connection
> PUBLIC PROCEDURE Connect()
> $Con.Close()
> $Con.Type = "mysql"
> $Con.Host = "localhost"
> $Con.Login = "blabla"
> $Con.Port = "3306"
> $Con.Name = "tradewaste"
> $Con.Password = "whatever"
> $Con.Open()
> END
>
> Module Main ......
> PUBLIC SUB Main()
> Connect()
> FRMStart.Visible = True
> END
>
> FRMStart exists but has no controls on it yet.
>
> When I run this, I get "Unknown Identifier: Connect at line 4 in
> Main.module"
How about changing Connect() to MODMain.Connect() ?
Best Regards
Kari
More information about the User
mailing list