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.
prameshAsked:
Who is Participating?
 
DalinConnect With a Mentor Commented:
Need to set reference to Microsoft DAO 3.6
0
 
TimCotteeCommented:
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
All Courses

From novice to tech pro — start learning today.