AdoFields:Append()

<< Click to Display Table of Contents >>

Navigation:  Ado Classes > AdoFields Class >

AdoFields:Append()

Previous pageReturn to chapter overviewNext page

Purpose

Appends an Field to the collection

 

Prototype

METHOD Append ( cName AS STRING, nType AS LONG, nSize AS USUAL, nAttrib AS USUAL  )   AS LOGIC 

 

Argument(s)

cName        Name of the new field

nType        Data type of the field

nSize        (Optional) Size of the column. Defaults to 0

nAttrib        (Optional) Attributes of the field. Defaults to 0

 

 

Return

LOGIC        TRUE is the append was succesfull, else FALSE

 

Example(s)

// Create a new recordset on the fly: 

oRs := AdoRecordset{}
oRs:Fields:Append("F1",adInteger ,NIL, adFldRowId) 
oRs:Fields:Append("F2",adVarChar ,10,  adFldMayBeNull) 
oRs:Fields:Append("F3",adBoolean ,NIL, adFldMayBeNull) 
oRs:Fields:Append("F4",adDate    ,NIL, adFldMayBeNull) 
oRs:Fields:Append("F5",adDouble  ,NIL, adFldMayBeNull) 
// Fill the recordset with data 
aFields := "F1","F2","F3","F4","F5" 
oRs:Open(NIL,NIL,adOpenStatic,adLockOptimistic,-1) 
FOR i = 1 TO 50 
      oRs:AddNew(aFields, I,CHR(64+I%26),I%2=0,Today()+i,SQRT(i)) 
NEXT 

See Also

AdoFields, AdoFields:Delete(), AdoField