I have a similar issue (somewhat) -- VB6 and Access97

My code in Option Explicit is

Dim dbs2 As Database

In the Private Sub Form_Load(), I have

Set dbs2 = OpenDatabase("C:\Program Files\members\members.mdb",True,False)

The Run Time Error I get is: Couldn't find file 'C:\Program Files\Members\Members.mdb'.
In the Debug: When the cursor hovers over dbs2, the response is dbs2 = Nothing

Can anyone please explain what causes the database not to be recognized. I can open the database in Access97 with no problem and VB6 seems to work alright.


if your using adodc and datagrid for the connection this may help

Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source = " & App.Path & "\database.mdb; Persist Security Info=False; Jet OLEDB:Database Password=PASSWORD"
Adodc1.RecordSource = "Select * from log"
Set DataGrid1.DataSource = Adodc1

replace the capitalize PASSWORD with the password of your database ".mdb"

Thanks but I use Access 2007 VBA and use DAO. I consider this closed though because I cannot use VB6, no thanks to MS.