how would I connect my access in my vb?
How would I connect my access to vb?
Collapse
X
-
Originally posted by czi02how would I connect my access in my vb?
In your Main Module: (declare general declarations)
Option Explicit
'declare global variable
Public cnnDb As New ADODB.Connectio n
Sub Main()
'change into the project directory
ChDrive Left(App.Path, 2)
ChDir Mid(App.Path, 3)
'open the database
cnnDb.Open "Provider = Microsoft.Jet.O LEDB.3.51;" _
& "Data source = Babylon.mdb"
MsgBox ("Connection is now open")
'load the main form
frmInvoiceView. Show 1
'close the database
cnnDb.Close
MsgBox ("Connection is now closed")
End Sub
Comment