i want to link my forms with access tables and dont want to use the odbc object. i need to use the ADO is it posible and how.

for in my first instance it worked, but when i moved it to another computer it signaled "Canot find database"

Help pliz

Recommended Answers

All 4 Replies

You can connect your Access Table with your VB form using different method. By using ADO, you can connect like this:

You have to select "Microsoft ActiveX data Object 2.0 or higher" from the preference of your VB.

Then, write this code in the module section:
Public ConnectData As New ADODB.Connection

'For making Connection
Public Sub Connect2DB()
Set ConnectData = New ADODB.Connection
ConnectData.Provider = "Microsoft.Jet.OLEDB.4.0; Data Source = " & App.Path & "\Your AccessDatabase Name.mdb;"
ConnectData.Open

end sub

Whenever you need connection, call this connection by wringting "Call Connect2DB"

you need to use RECORDSET object for fetching data from database and display in form.

Hi,

You need to update your recordset. If it doesn't help then it may possible your database has been corrupted. Try compact and repair utility to repair your database. If you're still not able to repair the mdb file try Stellar Phoenix access recovery tool. This access repair software repair corrupted access database file and mdb files.

When you have already the code but still the connection doesn't work try to check the path of yur connection because as what you have said you have transferred your program in other computer.

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.