Home > How-To Library > Database

How to link to an external Foxpro table.

**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * ****************************************************************
Sub Link_External() ' This procedure creates a new tabledef and links a FoxPro 3.0 table to it by ' setting the Connect and SourceTableName properties. Dim dbs As Database, tdf As TableDef Dim strPath As String Set dbs = OpenDatabase(strPath) ' Create a new tabledef in a Microsoft Jet database. Set tdf = dbs.CreateTableDef("Employees") ' Set the Connect and SourceTableName properties to link the tabledef. With tdf .Connect = "FoxPro 3.0;DATABASE=Path" .SourceTableName = "Emp" End With ' Append the linked tabledef. dbs.TableDefs.Append tdf End Sub

If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.