case sensitive

Discussion in 'ASP General' started by Jeff, Aug 1, 2004.

  1. Jeff

    Jeff Guest

    i have this on my signup page
    Set rs = Conn.Execute("SELECT * from rounds")

    DO WHILE NOT rs.EOF

    IF request.form("username") = rs.fields.item("username").value THEN

    response.redirect("register2.asp")

    END IF

    rs.MoveNext
    LOOP

    the problem is.. some who signed up as say Jeff can still sign up as jeff
    or jeFF how can i fix this??
    Jeff
    Jeff, Aug 1, 2004
    #1
    1. Advertising

  2. "Jeff" wrote:
    >
    > the problem is.. some who signed up as say Jeff can
    > still sign up as jeff or jeFF how can i fix this??


    Are you asking how to require case sensitivity or how to eliminate it?



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, Aug 1, 2004
    #2
    1. Advertising

  3. Jeff

    Jeff Guest

    How to eliminate it... as is.. I could sign up as Jeff.. and it wouldne stop
    me from signing up as jeff or jefF i want Jeff to be blocked in any case
    form
    Jeff


    "Dave Anderson" <> wrote in message
    news:410d26a4$0$65608$...
    > "Jeff" wrote:
    > >
    > > the problem is.. some who signed up as say Jeff can
    > > still sign up as jeff or jeFF how can i fix this??

    >
    > Are you asking how to require case sensitivity or how to eliminate it?
    >
    >
    >
    > --
    > Dave Anderson
    >
    > Unsolicited commercial email will be read at a cost of $500 per message.

    Use
    > of this email address implies consent to these terms. Please do not

    contact
    > me directly or ask me to contact you directly for assistance. If your
    > question is worth asking, it's worth posting.
    >
    >
    Jeff, Aug 1, 2004
    #3
  4. Jeff wrote:
    > i have this on my signup page
    > Set rs = Conn.Execute("SELECT * from rounds")
    >
    > DO WHILE NOT rs.EOF
    >
    > IF request.form("username") = rs.fields.item("username").value THEN
    >
    > response.redirect("register2.asp")
    >
    > END IF
    >
    > rs.MoveNext
    > LOOP
    >
    > the problem is.. some who signed up as say Jeff can still sign up
    > as jeff or jeFF how can i fix this??
    > Jeff



    The best way is to allow your database to do the filtering (assuming your
    database is sql server or jet, which are both case insensitive by default).
    Why in the world are you returning all the rows from your table with all the
    fields simply to determine if a record containing "jeff" exists? OK, so you
    probably don't realize that there is a more efficient way to do it ...

    sql="select count(*) from rounds where [username]='" & _
    replace(request.form("username"),"'","''") & "'"
    set rs=conn.execute(sql,,1)
    if rs(0) > 0 then
    'user exists
    else
    'user does not exist
    end if


    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Aug 1, 2004
    #4
  5. Oh! I see, you want it to be case sensitive? If "Jeff" exists. you want it
    to reject "jeff"?

    That's a lot harder, especially if your db is Access. It's time to tell us
    what database type and version you are using.

    Bob Barrows

    Jeff wrote:
    > How to eliminate it... as is.. I could sign up as Jeff.. and it
    > wouldne stop me from signing up as jeff or jefF i want Jeff to be
    > blocked in any case form
    > Jeff
    >
    >
    > "Dave Anderson" <> wrote in message
    > news:410d26a4$0$65608$...
    >> "Jeff" wrote:
    >>>
    >>> the problem is.. some who signed up as say Jeff can
    >>> still sign up as jeff or jeFF how can i fix this??

    >>
    >> Are you asking how to require case sensitivity or how to eliminate
    >> it?
    >>

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Aug 1, 2004
    #5
  6. Jeff

    Jeff Guest

    well... ummm yes.. it is access :( and yes.. you are correct, i want it to
    reject any form of jeff
    Jeff


    "Bob Barrows [MVP]" <> wrote in message
    news:eh%232Ie$...
    > Oh! I see, you want it to be case sensitive? If "Jeff" exists. you want it
    > to reject "jeff"?
    >
    > That's a lot harder, especially if your db is Access. It's time to tell us
    > what database type and version you are using.
    >
    > Bob Barrows
    >
    > Jeff wrote:
    > > How to eliminate it... as is.. I could sign up as Jeff.. and it
    > > wouldne stop me from signing up as jeff or jefF i want Jeff to be
    > > blocked in any case form
    > > Jeff
    > >
    > >
    > > "Dave Anderson" <> wrote in message
    > > news:410d26a4$0$65608$...
    > >> "Jeff" wrote:
    > >>>
    > >>> the problem is.. some who signed up as say Jeff can
    > >>> still sign up as jeff or jeFF how can i fix this??
    > >>
    > >> Are you asking how to require case sensitivity or how to eliminate
    > >> it?
    > >>

    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >
    Jeff, Aug 1, 2004
    #6
  7. Jeff

    Jeff Guest

    And not sure what you mean by what version. The access is with Office 2002
    if that is what you mean.


    "Bob Barrows [MVP]" <> wrote in message
    news:eh%232Ie$...
    > Oh! I see, you want it to be case sensitive? If "Jeff" exists. you want it
    > to reject "jeff"?
    >
    > That's a lot harder, especially if your db is Access. It's time to tell us
    > what database type and version you are using.
    >
    > Bob Barrows
    >
    > Jeff wrote:
    > > How to eliminate it... as is.. I could sign up as Jeff.. and it
    > > wouldne stop me from signing up as jeff or jefF i want Jeff to be
    > > blocked in any case form
    > > Jeff
    > >
    > >
    > > "Dave Anderson" <> wrote in message
    > > news:410d26a4$0$65608$...
    > >> "Jeff" wrote:
    > >>>
    > >>> the problem is.. some who signed up as say Jeff can
    > >>> still sign up as jeff or jeFF how can i fix this??
    > >>
    > >> Are you asking how to require case sensitivity or how to eliminate
    > >> it?
    > >>

    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >
    Jeff, Aug 1, 2004
    #7
  8. Jeff

    Lord Merlin Guest

    "Jeff" <> wrote in message
    news:#6RO0k$...
    | And not sure what you mean by what version. The access is with Office 2002
    | if that is what you mean.
    |
    |
    | "Bob Barrows [MVP]" <> wrote in message
    | news:eh%232Ie$...
    | > Oh! I see, you want it to be case sensitive? If "Jeff" exists. you want
    it
    | > to reject "jeff"?
    | >
    | > That's a lot harder, especially if your db is Access. It's time to tell
    us
    | > what database type and version you are using.
    | >
    | > Bob Barrows
    | >
    | > Jeff wrote:
    | > > How to eliminate it... as is.. I could sign up as Jeff.. and it
    | > > wouldne stop me from signing up as jeff or jefF i want Jeff to be
    | > > blocked in any case form
    | > > Jeff
    | > >
    | > >
    | > > "Dave Anderson" <> wrote in message
    | > > news:410d26a4$0$65608$...
    | > >> "Jeff" wrote:
    | > >>>
    | > >>> the problem is.. some who signed up as say Jeff can
    | > >>> still sign up as jeff or jeFF how can i fix this??
    | > >>
    | > >> Are you asking how to require case sensitivity or how to eliminate
    | > >> it?
    | > >>
    | > --
    | > Microsoft MVP - ASP/ASP.NET
    | > Please reply to the newsgroup. This email account is my spam trap so I
    | > don't check it very often. If you must reply off-line, then remove the
    | > "NO SPAM"
    | >
    | >
    |
    |

    Well, you could always instead do this in ASP, thus making it more robust
    and more flexible:



    DO WHILE NOT rs.EOF


    username = UCASE(rs.fields.item("username").value)

    IF UCASE(request.form("username")) = username THEN

    response.redirect("register2.asp")

    END IF

    rs.MoveNext
    LOOP



    --


    Kind Regards
    Rudi Ahlers
    +27 (82) 926 1689

    Greater love has no one than this, that he lay down his life for his friends
    (John 15:13).
    Lord Merlin, Aug 1, 2004
    #8
  9. Jeff

    Jeff Guest

    Ok.. so that would set the username to all uppercase... then check against
    it... got ya..
    thanks


    "Lord Merlin" <_SPAM> wrote in message
    news:cejeru$4il$...
    > "Jeff" <> wrote in message
    > news:#6RO0k$...
    > | And not sure what you mean by what version. The access is with Office

    2002
    > | if that is what you mean.
    > |
    > |
    > | "Bob Barrows [MVP]" <> wrote in message
    > | news:eh%232Ie$...
    > | > Oh! I see, you want it to be case sensitive? If "Jeff" exists. you

    want
    > it
    > | > to reject "jeff"?
    > | >
    > | > That's a lot harder, especially if your db is Access. It's time to

    tell
    > us
    > | > what database type and version you are using.
    > | >
    > | > Bob Barrows
    > | >
    > | > Jeff wrote:
    > | > > How to eliminate it... as is.. I could sign up as Jeff.. and it
    > | > > wouldne stop me from signing up as jeff or jefF i want Jeff to be
    > | > > blocked in any case form
    > | > > Jeff
    > | > >
    > | > >
    > | > > "Dave Anderson" <> wrote in message
    > | > > news:410d26a4$0$65608$...
    > | > >> "Jeff" wrote:
    > | > >>>
    > | > >>> the problem is.. some who signed up as say Jeff can
    > | > >>> still sign up as jeff or jeFF how can i fix this??
    > | > >>
    > | > >> Are you asking how to require case sensitivity or how to eliminate
    > | > >> it?
    > | > >>
    > | > --
    > | > Microsoft MVP - ASP/ASP.NET
    > | > Please reply to the newsgroup. This email account is my spam trap so I
    > | > don't check it very often. If you must reply off-line, then remove the
    > | > "NO SPAM"
    > | >
    > | >
    > |
    > |
    >
    > Well, you could always instead do this in ASP, thus making it more robust
    > and more flexible:
    >
    >
    >
    > DO WHILE NOT rs.EOF
    >
    >
    > username = UCASE(rs.fields.item("username").value)
    >
    > IF UCASE(request.form("username")) = username THEN
    >
    > response.redirect("register2.asp")
    >
    > END IF
    >
    > rs.MoveNext
    > LOOP
    >
    >
    >
    > --
    >
    >
    > Kind Regards
    > Rudi Ahlers
    > +27 (82) 926 1689
    >
    > Greater love has no one than this, that he lay down his life for his

    friends
    > (John 15:13).
    >
    >
    Jeff, Aug 1, 2004
    #9
  10. Yes, that is what I meant.

    You should be able to utilize the strconv() function to perform a case
    sensitive query. It will prevent the use of an index on the username field
    so performance will suffer.

    Select count(*) from rounds
    where strcomp([username],
    replace(request.form("username"),"'","''"),0) = 0

    HTH,
    Bob Barrows

    Jeff wrote:
    > And not sure what you mean by what version. The access is with Office
    > 2002 if that is what you mean.
    >
    >
    > "Bob Barrows [MVP]" <> wrote in message
    > news:eh%232Ie$...
    >> Oh! I see, you want it to be case sensitive? If "Jeff" exists. you
    >> want it to reject "jeff"?
    >>
    >> That's a lot harder, especially if your db is Access. It's time to
    >> tell us what database type and version you are using.
    >>
    >> Bob Barrows
    >>
    >> Jeff wrote:
    >>> How to eliminate it... as is.. I could sign up as Jeff.. and it
    >>> wouldne stop me from signing up as jeff or jefF i want Jeff to be
    >>> blocked in any case form
    >>> Jeff
    >>>
    >>>
    >>> "Dave Anderson" <> wrote in message
    >>> news:410d26a4$0$65608$...
    >>>> "Jeff" wrote:
    >>>>>
    >>>>> the problem is.. some who signed up as say Jeff can
    >>>>> still sign up as jeff or jeFF how can i fix this??
    >>>>
    >>>> Are you asking how to require case sensitivity or how to eliminate
    >>>> it?



    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Aug 2, 2004
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Boban Dragojlovic

    DropDownList values are case sensitive?

    Boban Dragojlovic, Nov 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,222
    Boban Dragojlovic
    Nov 6, 2003
  2. Martin Dechev
    Replies:
    0
    Views:
    525
    Martin Dechev
    Apr 2, 2004
  3. Replies:
    0
    Views:
    508
  4. Replies:
    1
    Views:
    2,457
    Mark P
    Apr 6, 2007
  5. Xah Lee
    Replies:
    4
    Views:
    934
Loading...

Share This Page