<< Click to Display Table of Contents >> AdoServer:FieldPut() |
![]() ![]() ![]() |
Set the value of a field identified by its position.
METHOD FieldPut ( uFieldID, uValue ) AS USUAL CLASS AdoServer
<uFieldID> the position/name/symbol of the required field
<uValue> the value to assign to the field.
<uValue> The value that has been assigned to the servers field. In some cases this value may differ from the value that you have assigned because the Server automatically trims string fields, and transforms empty strings into #Null values when the server allows these values.
The server will send a NOTIFYFIELDCHANGE when the FieldPut has been completed.
Note If the Server is at EOF or on a deleted record, all Fieldput() are ignored. No error message is generated, the FieldPut simply returns the uValue
Note 2 If you want to empty a field, or assign a NUll value the following options are available
Assume Lname = Character
oSrv:FieldPut(#Lname, NIL) // SQL Null
oSrv:FieldPut(#Lname, #Null) // SQL Null
oSrv:FieldPut(#Lname, #Empty) // Empty string
oSrv:FieldPut(#Lname, NULL_STRING) // Empty string, or SQL Null, depending on field attributes
Assume Discount is numeric
oSrv:FieldPut(#Discount, NIL) // SQL Null
oSrv:FieldPut(#Discount, #Null) // SQL Null
oSrv:FieldPut(#Discount, #EMpty) // 0
oSrv:FieldPut(#Discount, 0) // 0
Assume Hiredate is DateTime
oSrv:FieldPut(#HireDate, NIL) // SQL Null
oSrv:FieldPut(#HireDate, #Null) // SQL Null
oSrv:FieldPut(#HireDate, #EMpty) // Error: there is no empty date !
oSrv:FieldPut(#HireDate, NULL_DATE) // SQL Null