Today is...
Saturday, May 25, 2019
Welcome to Control.com, the global online
community of automation professionals.
Featured Video...
Featured Video
A demonstration of EtherCAT control of linear motors using the CTC EtherCAT master.
Our Advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive
Linking to a DBF file at runtime from VBA
Having trouble figuring out how to link a DBF file from Access 2000 VBA.
By Yosi Feigenbaum on 11 December, 2002 - 11:14 am

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{)} ( .)
yosi@ludan.co.il
-------------------------
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