Information générale
Titre:
Update Cursor for Remote Data
Versions des environnements
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....
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