Senin, 21 Maret 2011

Menampilkan Tabel Mysql di Grid Foxpro 9

Berikut adalah source kodenya :
Kita buat koneksi ke mysql terlebih dahulu.
Taruh di objek form pada prosedur load
vdbase = "mvc"
vuser = "root"
vpass = "123456"
msql = "DATABASE="+vdbase+";SERVER=localhost;port=3306;UID="+vuser+";PWD="+vpass+";provider=MSDASQLR;DRIVER={MySQL ODBC 3.51 Driver};"

PUBLIC ConnHandle
ConnHandle = SQLSTRINGCONNECT(msql)
kode di bawah ini di taruh di objek grid pada prosedur init
SQLEXEC(ConnHandle,"SELECT * FROM apl_barang","a")
thisform.Grid1.BackColor=RGB(0,128,255)
thisform.Grid1.RecordSource="a"

0 komentar:

Posting Komentar

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Justin Bieber, Gold Price in India