klik di bawah ini

Selasa, 28 Juni 2011

how to connect mysql and gambas

Connecting the gambas with a mysql database, the script is quite short, the declaration of this script is not much different from those in PHP, cuman difference here we create the script in a form that will be loaded.

Previously please create a database connection and resultnya declaration, section your top class form

example

PRIVATE koneksi AS Connection
PUBLIC rst AS Result


'PRIVATE is the name of the connection after the connection to be made, namely the koneksi'

'RST after the Public is resultnya rst name, you can modify to suit your needs RST'

Okeh database we specify, we will now connect the database with the gambas program.

PUBLIC SUB Form_Open()

koneksi = NEW Connection
koneksi.Type = "mysql"
koneksi.Host = "localhost"
koneksi.Login = "root"
koneksi.Password = "passwordmysqlanda"
koneksi.Name = "namadatabbasedariprgoramanda"
koneksi.Open
END

Only a short script above you can make a program that is integrated with the database in gambas

Related Article:

0 komentar:

Posting Komentar


 

Teman-teman