Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > case sensitive

Reply
Thread Tools

case sensitive

 
 
Jeff
Guest
Posts: n/a
 
      08-01-2004
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


 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      08-01-2004
"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.


 
Reply With Quote
 
 
 
 
Jeff
Guest
Posts: n/a
 
      08-01-2004
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" <(E-Mail Removed)> wrote in message
news:410d26a4$0$65608$(E-Mail Removed) ...
> "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.
>
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-01-2004
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"


 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-01-2004
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" <(E-Mail Removed)> wrote in message
> news:410d26a4$0$65608$(E-Mail Removed) ...
>> "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"


 
Reply With Quote
 
Jeff
Guest
Posts: n/a
 
      08-01-2004
well... ummm yes.. it is access and yes.. you are correct, i want it to
reject any form of jeff
Jeff


"Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
news:eh%232Ie$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> > news:410d26a4$0$65608$(E-Mail Removed) ...
> >> "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"
>
>



 
Reply With Quote
 
Jeff
Guest
Posts: n/a
 
      08-01-2004
And not sure what you mean by what version. The access is with Office 2002
if that is what you mean.


"Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
news:eh%232Ie$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> > news:410d26a4$0$65608$(E-Mail Removed) ...
> >> "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"
>
>



 
Reply With Quote
 
Lord Merlin
Guest
Posts: n/a
 
      08-01-2004
"Jeff" <(E-Mail Removed)> wrote in message
news:#6RO0k$(E-Mail Removed)...
| And not sure what you mean by what version. The access is with Office 2002
| if that is what you mean.
|
|
| "Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
| news:eh%232Ie$(E-Mail Removed)...
| > 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" <(E-Mail Removed)> wrote in message
| > > news:410d26a4$0$65608$(E-Mail Removed) ...
| > >> "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).


 
Reply With Quote
 
Jeff
Guest
Posts: n/a
 
      08-01-2004
Ok.. so that would set the username to all uppercase... then check against
it... got ya..
thanks


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

2002
> | if that is what you mean.
> |
> |
> | "Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
> | news:eh%232Ie$(E-Mail Removed)...
> | > 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" <(E-Mail Removed)> wrote in message
> | > > news:410d26a4$0$65608$(E-Mail Removed) ...
> | > >> "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).
>
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-01-2004
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]" <(E-Mail Removed)> wrote in message
> news:eh%232Ie$(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>>> news:410d26a4$0$65608$(E-Mail Removed) ...
>>>> "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"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
check file exists with case sensitive on a case insensitive filesystem Xah Lee Perl Misc 4 04-05-2009 11:21 PM
case insensitive find on case sensitive stl map benhoefer@gmail.com C++ 1 04-06-2007 08:42 PM
Outputcache shared property is case sensitive? eriera1@hotmail.com ASP .Net 0 07-29-2004 07:37 PM
Re: Results from fileinfo - how to return, case-sensitive Martin Dechev ASP .Net 0 04-02-2004 01:33 PM
DropDownList values are case sensitive? Boban Dragojlovic ASP .Net 0 11-06-2003 03:30 PM



Advertisments