Linking to a DBF file at runtime from VBA

Y

Thread Starter

Yosi Feigenbaum

I'm trying to create a link to an external DBF file from within Access 2000 VBA at run time. I've written the following code but the append line that creates the link:CurrentDb.TableDefs.Append (MyTableDef)
generates an error 3251: Operation is not supported for this type of object

Any Ideas?

Thanks,

(8{)} ( .)
[email protected]
-------------------------
Sub MySub()

Dim MyTableDef As DAO.TableDef

Set MyTableDef = CurrentDb.CreateTableDef("MyLinkedTable")
MyTableDef.Connect = "dBase 5;DATABASE=d:\citect\user\Myfirst\"
MyTableDef.SourceTableName = "trend.dbf"

CurrentDb.TableDefs.Append (MyTableDef)

End Sub
 
Top