Solved

VB6 giving error when connecting to Access 2000?

Posted on 2000-05-03
5
154 Views
Last Modified: 2010-05-02
VB 6 is giving error when connecting to Access 2000 using DAO. But it is working fine for Access 97.
0
Comment
Question by:pramesh
5 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 50 total points
ID: 2773002
Need to set reference to Microsoft DAO 3.6
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 2773024
Or ADO 2.1 or higher depending on whether using ADO or DAO.

You can obtain these from Microsoft site.
0
 

Author Comment

by:pramesh
ID: 2773075
Edited text of question.
0
 

Author Comment

by:pramesh
ID: 2773082
Edited text of question.
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2773644
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now