Finding max autonumber...

Results 1 to 2 of 2

Thread: Finding max autonumber...

  1. #1
    Join Date
    Dec 1969

    Default Finding max autonumber...

    For some reason I get this error message:<BR><BR>Item cannot be found in the collection corresponding to the requested name or ordinal. <BR><BR>Refering to the third line below :-<BR><BR> SQL = "SELECT max(CommentID) FROM Comments"<BR><BR> SQL, conn<BR> <BR>------- commentID = RS("CommentID") ----------<BR><BR> response.write commentID<BR><BR>Anyone got any ideas? CommentID is an autonumber.<BR><BR>Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: Finding max autonumber...

    SQL = "SELECT max(CommentID) as CommentID FROM Comments"<BR><BR><BR>You have to give the result of an aggregate function an name in order to retrieve it by an name.<BR><BR>Dutch<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