Recordset -Addnew method

Results 1 to 3 of 3

Thread: Recordset -Addnew method

  1. #1
    Join Date
    Dec 1969

    Default Recordset -Addnew method

    Hi all,<BR> I have a question in the Recordset -AddNew property.<BR>say if I have a table with a column whose Auto-Id is set to ON.<BR>If I use Recordset.AddNew() property to create a new reord,<BR>will the new record immediately have a value for that Auto-Id column or will it have a value only after the record has been committed?<BR>Hope I am not confusing U.<BR><BR>For ex.<BR><BR>If there is a field called Inventory-Id whose Auto-Id is set to On.<BR>and if the previous record&#039s inventory-id value is 49.<BR>If I say recordset.addnew()<BR>will a value of 50 be assigned immediately to the inventory-id column?<BR>Please let me know.<BR>Thanks,<BR>Pooja.<BR>

  2. #2
    E! Guest

    Default RE: Recordset -Addnew method

    rs.AddNew will add a new record to the db... So if you have an auto increment field, the next added record will be 50, 51, 52 and so on...

  3. #3 Guest

    Default RE: Recordset -Addnew method

    The NEW ID will not be assigned and AVAILABLE until after the .Update method. If a value you need to include in the table is dependent on the records @@IDENTITY then you will need to update the field and use the .Update method again. That is theory on my part I have never had to use back to back .Update methods but it should work. Because until you change the record with a .MoveNext or similar method you are still on the NEW record.<BR><BR>Good Luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts