Today is...
Monday, October 14, 2019
Welcome to, the global online
community of automation professionals.
Featured Video...
Featured Video
A tutorial introduction to programming using the QuickBuilder Programming Environment.
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?


(8{)} ( .)
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