General information
Category:
COM/DCOM and OLE Automation
Title:
Connection to Access
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only