Minggu, 22 Januari 2012

Besic Koneksi DB Acces Berpasswod with VB6.0 7 Cristal Report 8.5


Besic Kode Coneksi DB Acces Berpasswordnya adalah :
Option Explicit
Dim Database As Connectio
Dim WithEvents rs As Recordset


Sub konek()
Set Database = Nothing
Set Database = New Connection
Database.CursorLocation = adUseClient
Database.Open "PROVIDER=MSDataShape;Data PROVIDER= microsoft.jet.oledb.4.0;Data Source=" _
& App.Path & "\Database1.mdb;Jet OLEDB:Database Password=password databasenya; "
End Sub


Pada form load panggil procedure konek –nya
Private Sub Form_Load()
konek
Adodc1.ConnectionString = Database.ConnectionString
Adodc1.RecordSource = "nama_tabel"
Set DataGrid1.DataSource = Adodc1
Adodc1.Caption = "Count : " & Adodc1.Recordset.RecordCount ’menampilkan total Record
End sub


Besic Code Memanggil Cristal Repot dengan Db Acces Berpassword

Dim strFormula As String
   strFormula = "{NamaTabel.Nama_Field}= '" & Combo.Text & "'"
    With CrystalReport1
        .Destination = crptToWindow
        .SelectionFormula = IIf(Combo.Text = "[none]", "", strFormula)’Fiter  pencetakan
        .ReportFileName = App.Path & "\Laporan_Harian.rpt" 'assign report file
        .Password = Chr(10) & "password" 'password databasenya
        .WindowState = crptMaximized 'maximized - minimized or normal
        .DataFiles(0) = App.Path & "\Database1.mdb" 'nama databse dan URL Penyimpanan
        .Action = 1 'show report
    End With

Donload Articel Nya di Sini : VB6.0 & CR 8.5 dengan DB Acces Berpassword
Go To Artikel Project VB Conection BD Acces Passwo

2 komentar: