Koneksi Vb.Net dengan MS Access  

Import System.Data.OleDb
public class form1
dim kns as new OleDbConnection
dim da as new OleDbDataAdapter
dim dt as new datatable
Public Sub form1_load( ...... ) mybase.load
'ini utk access 2003 kebawah
kns.ConnectionString = "Provider = Microsoft.Jet.OleDb.4.0;data source=mydata.mdb;Jet Oledb:Database Password='passku'"
'Ni tuk Access 2007 kebawah
'kns.ConnectionString = "Provider = Microsoft.Ace.OleDb.12.0;data source=*.mdb/*accdb;Jet Oledb:Database Password='passku'"
da.SelectCommand=new oledbCommand("select * from tabel1",kns)
da.fill(dt)
datagridview1.datasource=dt
end sub
end class




This entry was posted on 10.19 and is filed under . You can leave a response and follow any responses to this entry through the Langganan: Posting Komentar (Atom) .

0 komentar