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
Rabu, 21 September 2011
Kode koneksi VB.net dengan MS.Access
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar