Cara Koneksi Visual Basic 6 Dengan Database Access Berpassword
Private Sub Form_Load() Dim Conn As Connection Dim RS As Recordset Set Conn = Nothing Set Conn = New Connection Conn.CursorLocation = adUseClient Conn.Open "PROVIDER= microsoft.jet.oledb.4.0;Data Source=" & App.Path & "\NamaDatabase.mdb;Jet OLEDB:Database Password=rahasia; " Set RS = New Recordset RS.Open "table1", Conn Set DataGrid1.DataSource = RS.DataSource End Sub
Jika anda menggunakan object ADODC seperti di bawah
Private Sub Form_Load() Adodc1.ConnectionString = "PROVIDER=microsoft.jet.oledb.4.0;Data Source=" & App.Path & "\NamaDatabase.mdb;Jet OLEDB:Database Password=rahasia; " Adodc1.RecordSource = "table1" Adodc1.Refresh Set DataGrid1.DataSource = Adodc1 DataGrid1.Refresh End Sub