PDA

Click to See Complete Forum and Search --> : Access '00?


Ovid
Mar 19th, 2000, 06:06 AM
______ Any idea why my Data Source object doesn't recognize MS Access 2000 files as valid database files? I know it is recognizing later versions of the same database file, but when I put the newer version in as the database name and then try to select a recordsource, it tells me that it is not a valid database file. If it would make a difference, I have downloaded SP3 for my VB6. Can you help? Please do.

pardede
Mar 19th, 2000, 03:03 PM
I presume you're using data controls and set the datasource property to the access2000 database. Well this does not workd with VB6/access2000: you need reference to DAO 4.0 but data control's datasource property is set to work with DAO 3.5 or lower. So what you need to do is avoid using the datasource property but open a recordset using code and assign it to the data control like this:

dim db as database, rs as recordset
set db = opendatabase(mydbname)
set rs = db.openrecordset(tablename)

set datacontrol1.recordset = rs

don't forget to set a reference to the correct version of DAO (or ADO if you're using it)

Clunietp
Mar 19th, 2000, 10:59 PM
Actually, it's DAO 3.6 you'll want to set a reference to....

Elias
Mar 20th, 2000, 12:21 AM
If you are doing code re-write, I would suggest strongly using ADO 2.0.

-Elias

pardede
Mar 20th, 2000, 01:36 PM
Thanks for the correction ClunietP. It is 3.6

Ovid
Mar 21st, 2000, 01:29 PM
Even with the code you supplied me, I end up getting a database format not recognized. With your code it does it when the project is run, rather than when I tried to select the the recordsource. Any ideas? (I do have an Office '97 CD, but when I install and run Access '97, I recieve an error stating that I don't have the license information on this computer.)

pardede
Mar 22nd, 2000, 09:58 PM
are you saying you are tring to select the recordsource in the design environment? well, i'm affraid you can't do that, so it might be true that you could only use code to access the database.. maybe someone else has a workaround?