Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remote data and cursor
Message
 
 
À
14/08/2005 12:31:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01040804
Message ID:
01040810
Vues:
13
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform