capturing autoNumber values..

Results 1 to 3 of 3

Thread: capturing autoNumber values..

  1. #1
    Join Date
    Dec 1969

    Default capturing autoNumber values..

    I am trying to capture the primary key of a record I just created... Im using an Access db and the "id" field which Im trying to get the value of is of type autoNumber... so it should have a value (it doesnt though)<BR>Code is below with the trouble spot highlighted.<BR><BR>Dim intContactId<BR>Dim rsContact<BR>Set rsContact = Server.CreateObject("ADODB.Recordset")<BR><BR>rsCo ntact.Open "Contact", db, adOpenForwardOnly, adLockOptimistic,adCmdTable<BR><BR>rsContact.AddNe w<BR>rsContact("email") = Request("email")<BR>rsContact("fName")= Request("fName")<BR>rsContact("lName")= Request("lName") <BR>rsContact.Update<BR>intContactId = rsContact("id") &#060;== THIS DOESNT RETURN A VALUE<BR>rsContact.Close <BR><BR>thanks<BR>john

  2. #2
    Join Date
    Dec 1969

    Default RE: capturing autoNumber values..

    try doing rsContact.movenext, after updating and then retrieve the value.

  3. #3
    Darren Neimke Guest

    Default RE: capturing autoNumber values..

    Have a read of this article, it may help you...<BR><BR><BR><BR><BR>HTH<BR>Darren

Posting Permissions

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