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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datacontrol problem

Status
Not open for further replies.

Elsje

Programmer
Feb 20, 2004
44
BE
Hello,

I'm busy with placing a project from VB5 to VB6, and everything works fine accept the data control.
Everytime I come to the place where I use the datacontrol I get the following error: "unrecognized database format".

This is the code that I use:
Data.RecordSource = here stands my sql
Data.RecordsetType = 1
Data.Options = 0
Data.Refresh

When the project was running in VB5 we never had problems with this control.

I'm using VB6, access 2000 and an dao connection.

Greetings
Els
 
Change reference form DAO 3.51 to Microsoft DAO 3.6 Object Library
Change the "Connect" property of the DC to "Access 2000
 
I'm already working with DAO3.6 object library.
But I have changed the "Connect" property from Access to Access 2000.
But now I have the following error "couldn't find installable ISAM
 

Because I didn't see them set in your posted code, I thought you were setting the Connect and DatabaseName properties in the DC's Properties Window.

In code you need to use:

Data2.Connect = "Access 2000;"
Data2.DatabaseName = "C:\MyDB.Mdb"

(Note the semicolon at the end of the Connect property string)
 
I've put the semicolon at the end of the property. But I still have the same problem. (couldn't find installable ISAM)

Is it possible that I need to add another reference?

This is the full code that I use:
Data.Connect = "Access 2000;"
Data.DatabaseName = Vis_mdb
Data.RecordSource = here stands my sql
Data.RecordsetType = 1
Data.Options = 0
Data.Refresh

(Vis_mdb contains the dir and the name of the database.)
 



Look in the properties window for the DC. In the Connect property, there should be a selection arrow which you can select "Access 2000".
Is it There?
If not, then install Service Pack 6 for VB6
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top