General discussion

Locked

Using Access 2000 and VB 6

By DavGordon ·
I am writting a program using Visual Basic 6. I am trying to read data from an Access 2000 database. I have created a blank form, added the data tool, set the connect property to access, set the DataBase name to point to the database. When I try to set the RecordSource it get an error message "Unrecognizes database format". Does VB6 recognize Access 2000? I know there was a change from Access 97 to 2000. I have looked in several places, including Microsoft and can not find a list of supported databases. Is this a support issue or am I missing something in the configuration. The database does open with Access, and is quite simple (four tables with no code).

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by JulianJ In reply to Using Access 2000 and VB ...

Well, access 2000 is supported in VB 6. Are you using DAO 3.51 or earlier to code your program? What I mean is that are you using the Data control packaged with VB 6? If you are, it will not work as the "old" data control is using DAO 3.51 and that cannot support access 2000 files.

To solve this, you can use another data control called the ADO data control. Goto "Project" > "Components" and select MS ADO data control. Or you can read data using program instead of the data control, but you need to import DAO 3.60 library from "Project" > "References".

Hope that helps and good luck

Collapse -

by DavGordon In reply to

I had it right up until I selected the component. After using the tool tips I found the right component. After that I could see the database. I also unloaded the DAO 3.51 referance and loaded the DAO 3.6 referance.

Thank you for your time.

Collapse -

by Miss Kitty In reply to Using Access 2000 and VB ...

Here's an example of code connecting to an Access database.
Dim objConn As New ADODB.Connection
Dim objCmd As New ADODB.Command
Dim objRS As New ADODB.Recordset
Dim objParam As ADODB.Parameter
Dim count As Integer

'set up the database pointer
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=E:\ACCESS\CONTRACT HAULERS\HAULER.mdb;User ID=ADMIN"
objRS.CursorType = adOpenDynamic
objRS.LockType = adLockOptimistic

'setting the Active Connection for the command object
objCmd.ActiveConnection = objConn

This is using an ADO connection.

Cathy

Collapse -

by DavGordon In reply to Using Access 2000 and VB ...

This question was closed by the author

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums