When do ID fields get added?

Results 1 to 2 of 2

Thread: When do ID fields get added?

  1. #1
    stevew Guest

    Default When do ID fields get added?

    I&#039;m trying to add a new record and then put the ID field into a variable.<BR><BR>At the moment I have<BR><BR>objRec.AddNew<BR>... <BR>add a bunch of values<BR>...<BR>objRec.Update<BR><BR>Dim IDfield<BR>IDField = objRec("IDField")<BR><BR>Response.write IDField<BR><BR>I&#039;m not getting anything written. Any ideas?<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: When do ID fields get added?

    Check you are opening the database correctly, see this faq:<BR>http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=79<BR><BR>Also it only works if you are using Access, if you are using SQL Server you will have to use @@identity in a stored procedure - or just use a query to get the maximum number in the id field (slackers method).

Posting Permissions

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