I have built a Remote View into a SQL Server data table.
I used the following code to build the view:
However when I USE the View ALAF_Mod1 and attempt to do a REPLACE <whatever> I get an error message:
No update tables are specified. Use the Tables property of the cursor.
I have no clue as to why these views are not allowing me to update them. I must have missed something.
Your advice would be greatly welcome.
Thanks,
JRB-Bldr
I used the following code to build the view:
Code:
OPEN DATABASE "TS ALAF"
CREATE SQL VIEW "ALAF_Mod1" REMOTE CONNECTION Touchstar SHARE AS ;
SELECT ContactID,;
ProjectID,;
Call_Date,;
APPL,;
CRC,;
Cust1Type,;
Cust1Status,;
Cust1Policy,;
Cust1ActionDate,;
Cust1ReqStatus,;
Cust1DeliveryReq,;
Cust1NotTaking,;
Cust1Notes,;
Agent_No,;
agent_name,;
AgentPhone;
FROM alaf_leads
DBSETPROP('ALAF_Mod1','view','tables','dbo.ALAF_Leads')
CLOSE DATABASE
* --- Now I Set The View Cursor Properties to make it Updatable ---
OPEN DATABASE "TS ALAF"
USE ALAF_Mod1 IN 0
SELECT ALAF_Mod1
* --- Get List Of Field Names ---
mnFldCnt = AFIELDS(aryFields)
USE
* --- I do this 15 times for 15 separate views like above ---
FOR ViewCntr = 1 TO 15
mcViewName = "ALAF_Mod" + ALLTRIM(STR(ViewCntr))
mcPolicyFld = "Cust" + ALLTRIM(STR(ViewCntr)) + "Policy"
SET DATABASE TO "TS ALAF"
* --- Define Key Fields ---
DBSETPROP(mcViewName+".ProjectID",'Field','KeyField',.T.)
DBSETPROP(mcViewName + "." + mcPolicyFld,'Field','KeyField',.T.)
* --- Make Each Field Updatable ---
FOR I = 1 TO mnFldCnt
mcFldName = aryFields(I,1)
IF UPPER(LEFT(mcFldName,5)) = "CUST1"
mcFldName = "Cust" + ALLTRIM(STR(ViewCntr)) + SUBSTR(mcFldName,6)
ENDIF
DBSETPROP(mcViewName+"."+mcFldName, 'Field','UpDatable',.T.)
ENDFOR
* --- Set Final Update Property ---
DBSETPROP(mcViewName,'View','SendUpdates',.T.)
ENDFOR
However when I USE the View ALAF_Mod1 and attempt to do a REPLACE <whatever> I get an error message:
No update tables are specified. Use the Tables property of the cursor.
I have no clue as to why these views are not allowing me to update them. I must have missed something.
Your advice would be greatly welcome.
Thanks,
JRB-Bldr