• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

VB6 giving error when connecting to Access 2000?

VB 6 is giving error when connecting to Access 2000 using DAO. But it is working fine for Access 97.
0
pramesh
Asked:
pramesh
1 Solution
 
DalinCommented:
Need to set reference to Microsoft DAO 3.6
0
 
TimCotteeHead of Software ServicesCommented:
Or ADO 2.1 or higher depending on whether using ADO or DAO.

You can obtain these from Microsoft site.
0
 
prameshAuthor Commented:
Edited text of question.
0
 
prameshAuthor Commented:
Edited text of question.
0
 
RuchiCommented:
For DAO, you need to reference DAO 3.6, not 3.5 in order to access MSAccess 2000.

visit the link
http://support.microsoft.com/support/kb/articles/q238/4/01.asp. it will tell you how to get unrecognized database format error message when upgradeing to access 2000.



If you go to RecordSource, you get the error.
In your Form_Load event, put the following code:

Private Sub Form_Load()
Dim daoDB36 As Database
'Dim rst As Recordset
Set daoDB36 = DBEngine.OpenDatabase("c:\yourfile.mdb")
'Dim rst = daoDB36.OpenRecordset(tablename or SQL Statement)
Set data1.Recordset = daoDB36.OpenRecordset(tablename or SQL Statement)
End Sub

Set the datasource of your bound controls to data1. You must then manually type in the datafield name, you cannot use the dropdown. You will have to bind your controls manually to the data control using the field names and add some code to make it work with DAO and MS Access 2000. This should work.  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now