Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB5 Data Access Problems 1

Status
Not open for further replies.

rhpen

Programmer
Nov 2, 2005
40
US
Have a VB5 program that used to access an Access97 database fine with the data control on a form as follows:

MSC1.Data1.RecordsetType = vbRSTypeSnapShot
MSC1.Data1.DatabaseName = "f:\admin\test.mdb"
MSC1.Data1.RecordSource = "MSC" 'MSC is a query
MSC1.Data1.Refresh

The database was converted to Access2000 and then the program gave the "unrecognized database format" error.

I read through various posts about it (not completely understanding them) and determined I should try the following code change:

Set daoDB36 = DBEngine(0).OpenDatabase("f:\admin\test.mdb")
Set rs = daoDB36.OpenRecordset("MSC")
Set MSC1.Data1.Recordset = rs
MSC1.Data1.Refresh

I then got "could not find installable ISAM" error on the "data1.refresh" line.

Not sure how to fix this. I am using Access XP on the PC running the program.

I guess I'm asking if it possible to access Access2000 databases from VB5 (data control on form) on a machine running AccessXP? If so, what VB5 code changes do I need?

Thank You
 
It's probable that your version of DAO is out of date - try
___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Do not use MSC1.Data1.Refresh.

It is not needed with this method and, even if it did work, will produce results you are not expecting.

Using the .Refresh, it will ignor the recordset already set to it and try to open a new connection and recordset based on the properties set (by default) for the data control (usually what is in the Properties Window for the control).

If there is nothing set there for the connection, or a typo, it will come up with this error.
If set correctly, you are back to your original problem.

This isn't an error of the Data Control, just a wrongly used Data control.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top