Private Sub Form_Load()
With db
 .Provider = "Microsoft.Jet.OLEDB.4.0"
 .Mode = adModeReadWrite
 .Open (App.Path & "\DBAddress.mdb")
End With
End Sub

Guys that's my code and I think that code contains no error. What's happening is that when I'm starting to execute the code.

It shows a Run Time Error: Could not find file 'C:\Documents and Settings\Mendoza\Desktop\mis system\DBAddress.mdb'.

Hope that you could help me out guys. Thank you and Have a nice one to all. =)

Recommended Answers

All 5 Replies

Copy DBAddress.mdb file into your project folder.

Copy DBAddress.mdb file into your project folder.

I already have the access file in my project folder... . Why is that there still a runtime error.

>I already have the access file in my project folder... . Why is that there still a runtime error.

No. It is not there. Please use absolute path instead of App.Path.

.open "c:\folder\dbaddress.mdb"

'C:\Documents and Settings\Mendoza\Desktop\mis system\DBAddress.mdb'.

is your file in that above target folder? if yes then plz check your all connection are same as above (if you use another connection other). if yes then plz check your address bar in my computer. does it show same as above?

Make an executable (exe) of your vb6 project
When a project is not made into an executable the "app.path" is some other directory.

Hope this works for you.. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.