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