General information
Title:
How to insert data in remote Foxpro table
I want to copy data from local Foxpro table to remote foxpro table.
The remote table is free table means it is not connected to any database
I tried by using ADO like
#DEFINE adLockBatchOptimistic 4
#DEFINE adCmdTable 2
#DEFINE ADLOCKOPTIMISTIC 3
#DEFINE adUseClient 3
#DEFINE adOpenStatic 3
#DEFINE ADOPENKEYSET 1
#DEFINE ADLOCKPESSIMISTIC 2
LOCAL loconn as adodb.connection
Path_of_batch = "N:\Data1"
loconn = CREATEOBJECT('adodb.connection')
CREATE CONNECTION loconn CONNSTRING "Provider=MSDASQL.1;Driver={Microsoft Visual FoxPro Driver};SourceDB=" + Path_of_batch + ";SourceType=DBF "
local lors As ADODB.Recordset
lors = CREATEOBJECT('ADODB.REcordset')
lors.ActiveConnection = loconn
lors.CursorLocation = 3 && adUseClient
lors.CursorType = 3 && adOpenStatic
lors.LockType = 3 && adLockOptimistic
lors.Open('select * from batch')
I get an error in lors.Open() line. I think recordset works fine if connection is made to the database instead of individual table like in my case I am connecting to table N:\data1\batch.dbf. Is there any other way to update the remote table by writing the insert command?
Thanks
Bharat
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