Question about a Type (Table)?

I have a project in VB 4 that contains this line:

Dim myTableCB As Table

When I open it up in VB 6 and try to compile this I get an error. It no longer recognizes Table as valid type.

I am assuming that a reference to a component or something like that must be missing. But how do I go about finding which Reference Table was part of?

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

rmichelsConnect With a Mentor Commented:
Table is probably part of DAO.  You need to add a reference to the Microsoft DAO object library.

Also the table object is an obsolete object in DAO.  It has been superceeded by a recordset object.

Using the OpenRecordSet method on a database object, you can create a table reference by supplying the proper constants.

db.OpenRecordset("tblName", dbOpenTable)
I believe you can check the project file: such as project1.vbp. You can open the project file by sending the file to notepad.
Also once you reference the DAO Library, Table should still be supported, but you should consider moving to the openrecordset call.
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

rrr333222Author Commented:

I have a refrence to DAO 3.6. In the orriginal VB 4 version ther DAO is 2.5 or something like that. Could this make a diference?

rrr333222Author Commented:
I tried removing the DAO 3.6 and replaced it with 2.5/3.0 3.5 none allowed for the Table type.
rmichelsCommented: are right, 3.5 or 3.6 will not compile with the Table type.

But I just tried 2.5 and 2.5/3.0 compatibility DAO and was able to compile with the Table type.

Check again..if it doesn't work, reject my answer :)
All Courses

From novice to tech pro — start learning today.