Re : Login page

Results 1 to 2 of 2

Thread: Re : Login page

  1. #1
    Join Date
    Dec 1969

    Default Re : Login page

    Thanks. I have tried for creating login page & getting . I want to check whether the user name and password exists in the table and checking for the recordcount is zero or not. for this , have used like <BR>strSQL = "select * from Users where Username=&#039;" & strUserName & "&#039; and Passwrd=&#039;" & strPassword & "&#039;"<BR>rsUsers.CursorType = 2<BR>rsUsers.LockType = 3<BR>rsUsers.Open strSQL, oConn<BR>If rsUsers.recordcount=0 Then<BR> displaying mesage that user does not exists<BR>else<BR> displaying mesage that user exists <BR>end if<BR> here I am getting some error and Error Type is:<BR>(0x80020009)<BR>Exception occurred. <BR><BR>please help me in this<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Re : Login page

    You can&#039;t use the statement: &#039;If rsUsers.recordcount = 0&#039; this way because the recordset only exists if data is returned. If no data is returned, then you have no recordset, so it&#039;s telling you an exception occurred because you are trying to check for something that only exists within a recordset. Therefore, you need to simply check whether or not the recordset itself exists, like this:<BR><BR>If rsUsers.BOF And rsUsers.EOF Then<BR>&#039;display message that user does not exist<BR>Else<BR>&#039;display message that user exists<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