Hi everybody
I am trying to get a report of ms access database(mdb database).
code Code:
Private cn As ADODB.Connection Private Sub Command1_Click() Dim cn As New ADODB.Connection Dim acc As Object Set acc = CreateObject("Access.Application") Dim strDbName As String strDbName = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source =" & App.Path & "\Pharmacy OP Ver 1.0.0.mdb " acc.OpenCurrentDatabase strDbName acc.DoCmd.OpenReport RptstaffDed, acViewPreview End Sub
I am trying to connect it, but there is an error that comes
"Microsoft Access can't open the database because it is missing or opened exclusively by another user, or it is not an ADP file.
Can somebody point out my mistakes
Please Help![]()




Reply With Quote