Home > database >  update
update

Time:09-28

Dw_1. Update (true, false) what's the function of the way

CodePudding user response:

Dwcontrol A reference to A DataWindow control, the DataStore, or child DataWindow.
The accept
(optional). A Boolean value specifying been the DataWindow control or DataStore should automatically perform an AcceptText the prior to performing the update:? TRUE? (The Default) Perform AcceptText. The update is canceled if The data fails validation.? FALSE? Do not perform AcceptText.
Resetflag
(optional). A Boolean value specifying been dwcontrol should automatically reset the update flags:? TRUE? . (the Default) Reset the flags? FALSE? Do not reset the flags.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
F1 Help
Receive datawindow in the input data, but not update the status, more commonly used in table updates, etc. All of the data table after the update is successful, with dw_1. ResetUpdate () reset dw_1. State,

CodePudding user response:

The first true meaning dw_1. Accepttext ()
The second meaning False is reset flag is False

CodePudding user response:

Dw_1. Update (true, false) what is the function of method
The first parameter is the accepttext, this have nothing to say, to accept input data,
The second parameter is the key, set to false, even didn't go to modify the data, if you click save again, datawindow will submit the update statement, which do not modify the state of the data, four kinds of data state and new; New and modified; Modified; Unmodified,
Which add and modify the corresponding insert operations; Modify the corresponding update

Beside the point,,,

CodePudding user response:

Dw_1. Update (true, false) what is the function of method
The first parameter: accepttext
The second parameter is: resetflag
A single data window, direct update do not have what problem; Multiple data window, it is important to note, see the translation below:

If you are updating multiple DataWindow controls or DataStores as part of one transaction, and set the resetflag argument to false.

(as part of a transaction, if you're ready to update multiple data window or data storage, set resetflag parameter to false,)

This will prevent the DataWindow from "forgetting" which rows to update in case one of the updates fails.

(this will prevent the data window when a data Windows update failure forgot to update some records,)

You can roll back, try to correct the situation, and update again.

(you can roll back things, try to modify and update again,)

Once all of the DataWindows have had been updated successfully, use the COMMIT to finalize the transaction and use ResetUpdate to reset the DataWindow 's status flags.

(once all data window has been updated successfully, use the COMMIT to complete the transaction, at the same time using resetupdate to reset the data window status flag,)

If you call the Update with the resetflag argument set to false and the do not call ResetUpdate, the DataWindow will attempt to issue the same SQL statements again the next time you call Update.
(if you call the update at the same time set up resetflag parameter to false and there is no call ResetUpdate method, when you update again, the data window will perform the same SQL syntax, again)

So much data Windows update or to be careful,

Translation is not good, don't laugh!

CodePudding user response:

Can KanTie: http://user.qzone.qq.com/94582975? Ptlang=2052

CodePudding user response:

http://user.qzone.qq.com/94582975? Ptlang=2052

CodePudding user response:

Where did you go PB8
Seems long time no see him,
Good strange oh,

CodePudding user response:

Still didn't understand the update is what mean? ~ ~

CodePudding user response:

145 the Update ()
Function feature function delete data in all data modification of window control changes such as transmitted to the database to
Update the data in the database Update () function will be called before updating the database AcceptText () function to float
In the current row/column on the contents of the edit box into the data buffer of window control
Grammar grammatical syntax dwcontrol. Update ({the accept, resetflag} {})
Parameters parameters parameters dwcontrol data window control name
The accept optional Boolean type specified data window control whether before updating the database automatically
Perform AcceptText () function to the contents of the edit box to buffer the effective value for the
The function of the TRUE, the default execution AcceptText () function if the data is not pass
A validation data update process be cancelled
The function of the FALSE does not perform AcceptText () function
Resetflag optional Boolean type indicates whether automatic reset after updating the database update mark
Valid values for
The default value is TRUE reset update sign
FALSE no longer an updated logo
Return value return value return an Integer function returns 1 on success when an error occurs when the function returns 1 if the value of any parameter
Is NULL, the Update () function returns NULL
Use usage usage usage in the execution of the Update () function must be used before SetTrans () or SetTransObject () function to establish data
Window with a database connection using SetTransObject () function when the connection is established the application efficiency of higher
But the application itself needs to be responsible for affairs use SQL to COMMIT and rollback of statements using SQL
The ROLLBACK
To perform the Update () function should check after the function return value to judge whether the execution of the function is successful in addition to
This also should check the transaction object is, of course, the data window is using SQLNRows attribute of the transaction object
This attribute indicates modification operations affected how many rows with the value of this attribute is provided by database vendors so the genus
The sexual value can be different meaning for different DBMS
By default database updated successfully after the Update () function is automatically reset to Update logo but for some
Purpose applications can also don't let the Update () function automatic reset Update logo at this time will need resetflag parameter
Set to FALSE so the Update () function performs satisfactory results after you can call the ResetUpdate () function clear
It is important to note, in addition to the updated logo to make application control transaction commit and rollback must use
Build a data window and the database connection SetTransObject ()
The Update () function may trigger data window control the following case
Z DBError
Z SQLPreview
Z UpdateEnd
Z UpdateStart
If the Update () to perform AcceptText () function then Update () function may also trigger the following case
Z ItemChanged
Z ItemError
The following code sample sample sample sample 1 use SetTransObject applications to connect to the database () function sets the data
Window after the use of other treatment was conducted on the transaction object to invoke the Update () function to Update the database
CONNECT USING the SQLCA;
Dw_employee. SetTransObject (SQLCA)
...//other processing
Dw_employee. The Update ()
This code before updating the database complete AcceptText () function and reset the data window updates standard
Chi
Sample sample sample sample 2 the following code is similar to the previous example function just before updating the database does not perform
The function of AcceptText () function
CONNECT USING the SQLCA;
Dw_employee. SetTransObject (SQLCA)
...//other processing
Dw_employee. Update (FALSE, TRUE)
Sample sample sample sample 3 the following code is similar to the function of the example 1 difference is to perform the Update () function after sample inspection
Check the function return value according to the Update () and whether or not successful to perform a COMMIT or ROLLBACK statement
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull