A list of products available on this site
Documentation for XtraMania's xtras
Prices and links to the online store
Xtras, PDFs, samples
Have a question? Ask us!
Contacts
Logo. www.xtramaina.com  
Home Search E-mail
ADOxtra Reference/rst.AddNew()

rst.AddNew()

Syntax

bSuccess=rst.AddNew()

Returns

True (1) if function completed successfully, false (0) otherwise.

Description

Calls the AddNew() method of the wrapped ADODB.Recordset object. After you call the AddNew method, the new record becomes the current record and remains current after you call the Update method.
After you call the AddNew method, the new record becomes the current record and remains current after you call the Update method. If the Recordset object does not support bookmarks, you may not be able to access the new record once you move to another record. Depending on your cursor type, you may need to call the Requery method to make the new record accessible.
If you call AddNew while editing the current record or while adding a new record, ADO calls the Update method to save any changes and then creates the new record.
Not supported in ADOxtraLite version.

Sample

rst.Open("SELECT PersonId,FirstName,LastName FROM Persons")
rst.AddNew()
rst.fields["FirstName"]="Mike"
rst.fields["LastName"]="Allfield"
rst.Update()

Site homeSearchContact author © Eugene Shoustrov. www.xtramania.com