Solved

VB6 giving error when connecting to Access 2000?

Posted on 2000-05-03
5
156 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

810 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