- Buat project baru
- Aktifkan Library yang dibutuhkan yaitu: Microsoft ADO Ext.2.8 for DDL and Security lewat menu:
- Tambahkan Modul dan ketikkan script dibawah ini:
- Pada saat Form_Load ketikkan script di bawah ini:
- Simpan project tersebut dan jalankan.
File -> New Project
Pilih STANDAR EXE kemudian klik OK
Project->References->Microsoft ADO Ext.2.8 for DDL and Security (dicentang) lalu klik Ok
Option Explicit
Public CrCd As New ADOX.Catalog
Public Cd As New ADOX.Table
Sub BuatDB()
Dim alamat As String
alamat = App.Path & "\CD.mdb"
CrCd.Create "Provider=Microsoft.jet.oledb.4.0;data source=" & alamat
CrCd.ActiveConnection = "Provider=Microsoft.jet.oledb.4.0;data source=" & alamat
Cd.Name = "TblCD"
Cd.Columns.Append "Judul", adVarWChar, 30
Cd.Columns.Append "Jenis", adVarWChar, 20
Cd.Columns.Append "Keping", adVarWChar, 10
Cd.Columns.Append "Jumlah", adVarWChar, 10
Cd.Columns.Append "Status", adVarWChar, 15
Cd.Columns.Append "Peminjam", adVarWChar, 30
Cd.Columns.Append "Tanggal", adDate
CrCd.Tables.Append Cd
Set CrCd = Nothing
End Sub
If Dir(App.Path & "\cd.mdb") = "" Then
BuatDB
End If