Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: autoinc in cursors

$
0
0
Re: autoinc in cursors
FoxInCloud
Re: autoinc in cursors
Jun. 4, 2013
06:01 pm
3SU12MDBVShow this entire thread in new window
Gratar Image based on email address
From:Tuvia Vinitsky
To:FoxInCloud support
XMLTOCURSOR will always fail with any autoinc fields. VFP docs say there is no way to use XMLTOCURSOR with autoinc fields except to turn it off and back on again at the cursor level with cursorset/getprop.


CURSORGETPROP('AutoIncError')

Contains True (.T.) when attempts to insert or update a value in a field that uses automatically incrementing field values generate an error message. 

Contains False (.F.) when attempts to insert or update a value in a field that uses automatically incrementing field values
does not generate an error message and the specified value to be inserted or updated is disregarded. Applies to cursors and sessions.

I think we'd better use

laField[m.liField, 18] = 0 && If the fields in the table use autoincrementing, the Step value is greater than 0

In order to make autoinc fields work in awserver.PropsRestore_DS_Alias_cXMLcursor you need to adjust the code as shown here:

* TBV
* This XMLTCURSOR will aways fail because the autoinc field throws a read-only error message.
* The VFP docs say the only way around that is to set autoincerror off.
LOCAL lcAINStat
lcAINStat = CURSORGETPROP("AutoIncError",m.lcResult)
=CURSORSETPROP("AutoIncError", "off", m.lcResult)
*



Viewing all articles
Browse latest Browse all 10393

Trending Articles