Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO sanity check...
Message
From
09/12/2002 05:56:03
 
 
To
08/12/2002 18:08:52
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00730767
Message ID:
00730823
Views:
28
Hi Pat.

Is there an easy way to delete and add a record to a RS?

To add a record to the RecordSet, use the AddNew() method. This method accepts two parameters:

FieldList: an array containing the names of the fields to be populated
Values: an array of values for the fields in the FieldList array

The field values can be populated individually like this:
oRs.AddNew()
oRs.Fields( "Cust_ID" ).Value = "DEWEY"
oRs.Fields( "Company" ).Value = "Dewey Cheetum and Howe"
oRs.Fields( "Contact" ).Value = "Seymour Cash"
or you can create two arrays, one with the field names and one with the field values (in the correct order!) and pass these arrays as arguments to the AddNew() method like this:
oRs.AddNew( laFields, laValues )
To delete a record from the RecordSet, just use its Delete() method:
oRs.Delete()
Previous
Reply
Map
View

Click here to load this message in the networking platform