Retrieving AutoNumber...

Results 1 to 2 of 2

Thread: Retrieving AutoNumber...

  1. #1
    Join Date
    Dec 1969

    Default Retrieving AutoNumber...

    I am trying to pull a just created records autonumber ID so I can insert it other places. I have read some explainations vaugly answering this problem but when I follow those explainations, I get the following error:<BR><BR>&#060;&#060;&#060;<BR><BR>Error Type:<BR>ADODB.Recordset (0x800A0CC1)<BR>Item cannot be found in the collection corresponding to the requested name or ordinal.<BR>/InstructorRegVerify_proc.asp, line 56<BR><BR>&#062;&#062;&#062;<BR><BR>Here is my code:<BR><BR>&#060;&#060;&#060;<BR><BR>objRec.Open strSQL, strConnDataData, adOpenForwardOnly, adLockOptimistic<BR><BR>objRec.AddNew<BR><BR>Sessi on("InstructID_ID") = objRec("InstrucID")<BR>objRec("InstrucFName") = Session("InstrucFName")<BR>objRec("InstrucMI") = Session("InstrucMI")<BR>objRec("InstrucLName") = Session("InstrucLName")<BR>objRec("InstrucAddress1 ") = Session("InstrucAddress1")<BR>objRec("InstrucCity" ) = Session("InstrucCity")<BR>objRec("InstrucState") = Session("InstrucState")<BR>objRec("InstrucZip") = Session("InstrucZip")<BR>objRec("InstrucAddress2") = Session("InstrucAddress2")<BR>objRec("InstrucPhone ") = Session("InstrucPhone")<BR>objRec("InstrucEmail") = Session("InstrucEmail")<BR>objRec("InstrucCompName ") = Session("InstrucCompName")<BR>objRec("InstrucComme nts") = Session("InstrucComments")<BR>objRec("InstrucID_ID ") = Session("InstructID_ID")<BR><BR>objRec.Update<BR>p ostid = Session("InstructID_ID")<BR>objRec.Close<BR>Set objRec = Nothing<BR><BR>&#062;&#062;&#062;<BR><BR>I am getting the error on line :<BR>objRec("InstrucID_ID") = Session("InstructID_ID")<BR><BR>There is nothing being updated in the database so, I am not sure what is blocking what where. I am trying to pull out the autonumber (objRec("InstrucID")) so that I can write it in 2 other fields (objRec("InstrucID_ID")) and in a &#039;password&#039; database.<BR><BR>Am I just too confused?<BR><BR>Thanks,

  2. #2
    Join Date
    Dec 1969

    Default RE: Retrieving AutoNumber...

Posting Permissions

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