I am working on writing VBA code to create a link to
FoxPro in Access 2000. The following source code is
written in Access 97. By executing it, the link table
(read/write) will be create in Access 97 database.
Function AttachTable(ExternTablePath As String, MyTable As
String) As Integer
Dim CurrentDatabase As Database, MyTableDef As TableDef
On Error GoTo NoAttach
AttachTable = -1
Set CurrentDatabase = DBEngine.Workspaces(0).Databases
(0)
Set MyTableDef = CurrentDatabase.CreateTableDef
(MyTable)
MyTableDef.Connect = "FoxPro 2.6;DATABASE=" &
ExternTablePath
MyTableDef.SourceTableName = MyTable
CurrentDatabase.TableDefs.Append MyTableDef
Exit Function
NoAttach:
AttachTable = 0
Exit Function
Resume Next
End Function
Since ISAM is no longer support in Access 2000, the
source code that I've had will never work. I know that ADO or ODBC should
resolve this problem. I have very little experience on
both of them.
Can anyone help me? I have been searching and
working with this issue for weeks. Any help will be very
appreciated.
Robbie
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx