Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connection to Access
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Connection to Access
Miscellaneous
Thread ID:
00410183
Message ID:
00410183
Views:
45
In one of my applications I need to copy the contents of a Foxpro table into Access.
I have been able to do the following from within VFP
- create an Access object
- create an empty Access database
- link the table into the Access database

This all looks as follows:

lcphl_xx = 'c:\temp\'
lcphlxx = 'trans_dk'
IF FILE(lcphl_xx + lcphlxx + '.mdb')
delete file (lcphl_xx + lcphlxx + '.mdb')
ENDIF

oAccess = CreateObject("Access.Application")
oAccess.newcurrentdatabase(lcphl_xx + lcphlxx )
oDb = oAccess.CurrentDb
oTable = oDb.CreateTableDef(lcphlxx)

* Link
oTable.Connect = "DBase IV;DATABASE=" + lcphl_xx
oTable.SourceTableName= lcphlxx + '.dbf'
oDb.TableDefs.Append( oTable )

What I would really like to have is not a 'link' to the table. I want to import the data into Access. Can anyone point me in the right direction.

Thanks,

Ron Brahma
Next
Reply
Map
View

Click here to load this message in the networking platform