Private Sub Command1_Click() Dim cn As ADODB.Connection Dim rs As ADODB.Recordset Set cn = New ADODB.Connection Set rs = New ADODB.Recordset On Error GoTo myerror cn.Provider = "Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Main.mdb;Persist Security Info=true;Password=123456789" cn.CursorLocation = adUseClient cn.Open rs.Open "SELECT * FROM BA_Data", cn, adOpenKeyset, adLockOptimistic, 0 MsgBox "Total record in table " & rs.RecordCount rs.Close cn.Close Exit Sub myerror: MsgBox Err.Number & " - " & Err.Description, vbOKOnly + vbExclamation, "button click: " & Erl End Sub
Here i m trying to connect a file which is password set
so but it gives Error with certain -2147217843 (80040e4d)
that is MDAC version is not matched as i have Windows 7
with full licensed copy still it is giving error n there is other option i got
on MS site to have compatible version of MDAC for my OS
so can u help me to solve this issue plz ASAP?