
Cannot open a table from a Access database file using VB5
Change the name of the table! System is a reserved word in VB--generates a
million variation on the error you saw!!!
The type mismatch is that it is trying to open the SYSTEM object, which it
obviously can't do.
Try that.
Sharman Staples
Quote:
>Hi all,
> I am trying to open a table in my database this way
> Dim wrkDefault As Workspace
> Dim dbsTeroMarine As Database
> Dim rstSystem As Recordset
> Set wrkDefault = DBEngine.Workspaces(0)
> Set dbsTeroMarine = wrkDefault.OpenDatabase(sDbaseName)
> ' sDbaseName is a global variable with the MDB dile name
> Set rstSystem = dbsTeroMarine.OpenRecordset("system")
> ' system is the name of the table in the Database file
>But at this point I get an error during runtime: Runtime Error '13': Type
>mismatch.
>What could be the problem???
>Should I create a tableDef before invoking the recordset or is there any
>other way.
>Could someone please give me a helping hand.
>Thanks in advance.
>Matts