Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote data and cursor
Message
 
 
To
14/08/2005 12:31:21
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01040804
Message ID:
01040810
Views:
15
At least one cursor property setting is missing.
=CURSORSETPROP("UpdateNameList", ,,,)
See 138094 and How to make SQL Pass-Through cursor updatable FAQ #8153 for working examples.

>I'm trying to learn how create an updatable cursor from remote data. I've strung together the following code:
>
>PUBLIC gnconnhandle
>STORE SQLCONNECT('TestingPatient', 'cm12345', 'mypassword') TO gnConnHandle
>IF gnConnHandle <= 0
>= MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
>ELSE
>= MESSAGEBOX('Connection made', 48, 'SQL Connect Message')
>
>SQLEXEC(gnconnhandle,"select req_det_id, test_name, autoser from labtest1 where req_det_id = 105695", "mycursor")
>
>
>CURSORSETPROP("SendUpdates",.T., "mycursor")
>cursorsetprop("BatchUpdateCount",1, "mycursor")
>cursorsetprop("CompareMemo",.T., "mycursor")
>cursorsetprop("FetchAsNeeded",.F., "mycursor")
>cursorsetprop("FetchMemo",.T., "mycursor")
>cursorsetprop("FetchSize",100, "mycursor")
>cursorsetprop("MaxRecords",-1, "mycursor")
>cursorsetprop("Prepared",.F., "mycursor")
>CURSORSETPROP("KeyFieldList", "autoser","mycursor")
>cursorsetprop("AllowSimultaneousFetch",.F., "mycursor")
>cursorsetprop("UpdateType",1, "mycursor")
>cursorsetprop("UseMemoSize",255, "mycursor")
>cursorsetprop("Tables","labtest1", "mycursor")
>cursorsetprop("UpdatableFieldList","req_det_id,test_name,autoser", "mycursor")
>cursorsetprop("WhereType",3, "mycursor")
>
>
>browse
>* = SQLDISCONNECT(gnconnHandle)
>ENDIF
>
>use
>
>So I get the window that confirms my connection is good, and then I get a browse window that shows the correct data. If I leave the data the way it is, and then close the browse window, everything is fine. If I change a value in the test_name column and try to close the browse window, I get an error message:
>
>No update tables are specified. Use the Tables property of the cursor.
>
>
>But I HAVE used the tables property! I DID specify the table to update!
>
>What am I doing wrong? I tried looking at the document that Sergey refers to in another string, but it seems far too complex to troubleshoot this one error....
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform