Record Set Counting

Results 1 to 3 of 3

Thread: Record Set Counting

  1. #1
    Join Date
    Dec 1969

    Default Record Set Counting

    I am developing an ASP script that need to validate a user name and password from a Qracle database table.<BR><BR>The user enters the username and password then goes to a script that does a query on the database to check for a valid username and a password match.<BR><BR>What is a good way to return a value equal to the number of records in a record set. i.e. I want to know how many records were returned from the select statment. (0 = user name not found or username/password not valid).<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Record Set Counting

    I don&#039t do Oracle,<BR><BR>however SQL Server 7.0 has an aggregate count function that you can trust, that is opposed to using a recordset count function

  3. #3
    e3 Guest

    Default RE: Record Set Counting

    try this:<BR><BR>sql = "select count(*) from schema.table_with_info where userid = &#039" & request.Form("userid") & "&#039 AND Password = &#039" & Request.Form("Password") & "&#039"<BR>rs.Open sql,Conn<BR>if rs.fields(0).value &#060; "1" then<BR> Invalid user code<BR>else<BR> Valid user code<BR>end if<BR><BR>But a better way if the Oracle tables are setup with permissions based on user:<BR><BR>on error resume next<BR>Conn.Open statement<BR>if Conn.State &#060;&#062; "1" then<BR> Invalid User Code<BR>else<BR> Valid User So continue code<BR>end if

Posting Permissions

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