Recordset issue

Results 1 to 2 of 2

Thread: Recordset issue

  1. #1
    Join Date
    Dec 1969

    Default Recordset issue

    I got a validation asp where user enters their password to view account info. <BR>The database contains 3 passwords for each account<BR>I use an SQL statement to find the account that has a match and store it in a recordset.<BR>Now I need to validate which password matched in that recordset to assign access rights.<BR><BR>Problem:<BR>When I use<BR> If userinput = recordsetvariable then...end if <BR>It always returns false because there seems to be a space at the end of the recordset variable. I tried all kinds of combinations. Even If recordsetvariable = "1234" and also If recordsetvariable = "1234 ". Nothing works. <BR>The SQL statement works so I don&#039t think the space is in the databasevariable.<BR>Is there any way to make the values match? <BR>Any suggestions? HEEEEEEELP!!!!!<BR>

  2. #2
    ActiveALLI Guest

    Default RE: Recordset issue

    use the trim function to delete all spaces from the begining or/and end of the string from the record set.<BR><BR>eg.<BR>Set rs = Server.CreateObject("ADODB.Recordset")<BR>&#039Ope n the recordset with your SQL statement and Connection <BR>password1fromDB = trim(rs("passw1"))<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