How to extract AutoNum from Access2000??

Results 1 to 2 of 2

Thread: How to extract AutoNum from Access2000??

  1. #1
    Join Date
    Dec 1969

    Default How to extract AutoNum from Access2000??

    Hi,<BR>Excuse me if this has been asked before. I want to update a table in Access 2000 which automatically creates an ID field. I then want to extract this ID.<BR>The code I&#039m using (see below) lets me extract all of the data except the ID field which Access creates.<BR>Any help appreciated....<BR><BR>Dim objRS<BR>Set objRS = Server.CreateObject("ADODB.Recordset")<BR>objRS.Op en "Establishment", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable<BR>objRS.AddNew<BR>objRS("Establishment ") = Request.Form("establishment_name")<BR>objRS("Addre ss1") = Request.Form("address1")<BR>objRS("Address2") = Request.Form("address2")<BR>objRS("Address3") = Request.Form("address3")<BR>objRS("City") = Request.Form("city")<BR>objRS("Postcode") = Request.Form("postcode")<BR>objRS.Update<BR><BR><B R>Dim strName, strValue, strField<BR>For each strField in objRS.Fields<BR> strName = strField.Name<BR> strValue = strField.Value<BR> Session(strName) = strValue<BR>Next<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: How to extract AutoNum from Access2000??

    &#060;&#060;How to extract AutoNum from Access2000??&#062;&#062;<BR><BR>...<BR>objRS.Updat e<BR>myNewID=objRS("ID") &#039just add this line<BR><BR>jw

Posting Permissions

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