Connection Database Use Module VB 6.0

In this steps, we call Step 4, before learn in this step, you must follow :
Step 1 : Cteate New Project
Step 2 : Create Main Form Application
Step 3 : Create Database and Tables

Please Follow steps below for Create Connection Database using Module in VB 6.0
Open your latest Project : Belajar VB


And the latest like below picture :
Click Project
Add Module
Click Open
Click save

And then fill below code in the Module1
Public ConnectDB As New ADODB.Connection
Public RSUsers As ADODB.Recordset
Public Sub OpenDB()
Set ConnectDB = New ADODB.Connection
Set RSUsers = New ADODB.Recordset
ConnectDB.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DBBelajarvb.mdb"
End Sub
in above step is connect to database using Module
Please see next steps :)

Subscribe to receive free email updates:

2 Responses to "Connection Database Use Module VB 6.0"

  1. Kalau databasenya disharingkan utk di buka pc lain.. apa coding utk vb nya .trims

    ReplyDelete
  2. Hi Decky,
    Databasenya menggunakan apa ya? access atau MySQL atau apa?
    Karena setiap database koneksinya berbeda beda :)

    ReplyDelete