Information générale
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement