quick question about dynamic variables

Results 1 to 3 of 3

Thread: quick question about dynamic variables

  1. #1
    Join Date
    Dec 1969

    Default quick question about dynamic variables

    I've tried to find it on here and haven't had much luck....how do you dynamically create a variable that increments? I have a database that I was to keep adding records to, with the primary key incrementing each time. I'm trying to use the SQL COUNT(*) command to get the number of rows in my database, but it doesn't seem to be getting that number into a variable I can use. Any suggestions?

  2. #2
    Join Date
    Dec 1969

    Default sorry, missing your point??

    you want to pull a newly insertede ID from the database or something??

  3. #3
    Join Date
    Dec 1969

    Default You don't want to do it that way...

    ...to see why, look at the comments near the beginning of this FAQ:<BR><BR>http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=79<BR><BR>But just for the record:<BR><BR>&#060;%<BR>Set RS = someConnection.Execute( "SELECT Count(*) FROM table" )<BR>theCount = RS(0)<BR>RS.Close<BR>%&#062;<BR><BR>Essentially the same thing as I show in the "DON&#039;T DO IT THIS WAY" code using Max(ID) instead.<BR><BR><BR>

Posting Permissions

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