[Gambas-user] problem with mysql

Adam Camp adam at ...2162...
Thu May 7 14:07:49 CEST 2009


Hi everyone,

I'm running Kubuntu 9.04 (Jaunty) on an Intel P4 3GHz (i386) with 1GB  
of RAM. I have tried the packaged Gambas2, and have also compiled the  
latest from source following the instructions on the website.

I am getting the following error:

Cannot find driver for database: MySQL.

However most of my MySQL connection details have come straight from  
the example:

MODMain.module
' Gambas module file
PUBLIC $conn AS NEW Connection
PUBLIC PROCEDURE Connect()
   $conn.Close()              ' Close the connection
   $conn.Type = "MySQL"       ' Type of connection
   $conn.Host = "localhost"   ' Name of the server
   $conn.Login = "root"       ' User's name for the connection
   $conn.Port = "3306"        ' Port to use in the connection, usually 3306
   $conn.Name = "menagerie"      ' Name of the data base we want to use
   $conn.Password = "password" ' User's password
   $conn.Open()               ' Open the connection
END

PUBLIC SUB Main()
    ' Run the Procedure to connect
   FMain.Visible = TRUE ' The main form of your program
END




FMain.class
' Gambas class file


PUBLIC SUB Button1_Click()
DIM $resProducts AS Result
ModMain.Connect()

   $resProducts = ModMain.$conn.Exec("SELECT * FROM products WHERE  
active ='1'")
   Button2.Text = ($resProducts!shortname)
END


I have loaded the gb.db extension.

Any help would be greatly appreciated.

Thanks

Adam

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.





More information about the User mailing list