Hi all, i've based the following code on this previous thread:
thread184-1716941
Code:
PUBLIC gnConnect
gnConnect = SQLCONNECT("AccountOperations")
SET MULTILOCKS ON
**setup empty cursor
?SQLEXEC( gnConnect, "select * from JML_dbCamsAssets where 1=0", "csr_dbCamsAssets" )
** get the data for importing
SELECT RECID AS FAS_RECID_NV,;
CLTNO AS CLIENTNO_NV,;
COUPRATE AS COUPRATE_MN,;
MKTCODE AS MKTCODE,;
MKTVALUE AS MKTVALUE_MN,;
DMATURE AS DMATURE_DT,;
DSELL AS DSELL_DT,;
DBUY AS DBUY_DT,;
PORTFOLIO AS PORTFOLIO_NV,;
CATEGORY AS CATEGORY_NV,;
MAJTYPE AS MAJTPE_NV,;
TYPE AS TYPE_NV,;
NOUNITS AS NOUNITS_NM,;
ACCOUNT AS ACCOUNT_NV,;
OWNCAT AS OWNCAT_NV,;
OWNCODE AS OWNCODE_NV,;
OWNNAME AS OWNNAME_NV,;
NAME AS NAME_NV,;
GROUP AS GROUPBY_NV,;
CLASS AS CLASS_NV,;
dlastChg AS DLASTCHG_DT,;
BROKDLR AS BROKERDEALER_NV;
FROM C:\DBVDATA2\FAS;
ORDER BY CLTNO;
INTO CURSOR CSR_FAS
xFields = "FAS_RECID_NV,CLIENTNO_NV,"
xFields = xFields + "COUPRATE_MN,MKTCODE_NV,MKTVALUE_MN,DMATURE_DT,DSELL_DT,"
xFields = xFields + "DBUY_DT,PORTFOLIO_NV,CATEGORY_NV,MAJTYPE_NV,TYPE_NV,"
xFields = xFields + "NOUNITS_NM,ACCOUNT_NV,OWNCAT_NV,OWNCODE_NV,OWNNAME_NV,"
xFields = xFields + "NAME_NV,GROUPBY_NV,CLASS_NV,DLASTCHG_DT,BROKERDEALER_NV"
?CURSORSETPROP("Buffering", 5,"csr_dbcamsassets")
?CURSORSETPROP("sendupdates", .T.,"csr_dbcamsassets")
?CURSORSETPROP("tables", "JML_dbCamsAssets","csr_dbcamsassets")
?CURSORSETPROP("KeyFieldList", "fas_recid_NV", "csr_dbcamsassets")
?CURSORSETPROP("UpdatableFieldList", xFields, "csr_dbcamsassets" )
?CURSORSETPROP("UpdateNameList", xFields, "csr_dbcamsassets" )
SELECT csr_dbCamsAssets
APPEND FROM DBF( "CSR_FAS" )
? "TableUpdate "
xjunk = TABLEUPDATE(2,.T.,"csr_dbcamsassets", AErrorArray )
?? xjunk
All of the CursorSetProps return True.
The TableUpdate returns False
AErrorArray has all negative numbers in.
Sometimes I get error 1491 "no update tables are specified. Use the Tables Property of the cursor"
What am I missing?
Is there something in the Tool->Options->Remote Data that I have to change?
TIA!