error pulling a field from a new record

Results 1 to 2 of 2

Thread: error pulling a field from a new record

  1. #1
    Ansley Guest

    Default error pulling a field from a new record

    I&#039ve run into this problem on two sites I&#039m working on. Input from a form goes into a table. The table has an autonumber field so that each user has a unique ID. On the same page that processes the form and adds the info to the database, I need to find out what that autonumber ID is and use it to add records to a different table. For some reason, It does add the record to the first table, but gets stuck when it tries to pull the ID back. If anyone could help I&#039d be very happy! <BR><BR>Here&#039s a sample of the code:<BR><BR>&#039 above here is just the code that adds the record using session variables<BR>objRecordset.Update<BR>objRecordset.C lose<BR>Set objRecordset = Nothing<BR>%&#062;<BR>&#060;%<BR>&#039 pull BabyID back from new records<BR>Set Connect = Server.CreateObject("ADODB.Connection")<BR>Connect .Open BabiesDB<BR>QueryString = "SELECT * FROM BabyInfo WHERE "<BR>QueryString = QueryString & "ParentsPhone = "<BR>QueryString = QueryString & Session("parents_phone")<BR><BR>Set BabyPull = Connect.Execute(QueryString)<BR>%&#062;<BR>&#060;% =BabyPull("ID")%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: error pulling a field from a new record

    objRecordset.Update<BR>lngID = objRecordset.UniqueID<BR>objRecordset.Close<BR>Set objRecordset = Nothing<BR>%&#062;<BR>&#060;%=lngID%&#062;

Posting Permissions

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