Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Case sensitive search in Access Database
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Case sensitive search in Access Database

 Post Reply Post Reply Page  123>
Author
vicky_c View Drop Down
Newbie
Newbie


Joined: 14 March 2003
Location: Scotland
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote vicky_c Quote  Post ReplyReply Direct Link To This Post Topic: Case sensitive search in Access Database
    Posted: 26 April 2003 at 6:25am

Hiya!

I have a big problem.  On my site I have a member area ppl can join and log in to but recently I found out that if you join with say the name 'Michelle' and there is already a 'michelle' in the database it would allow that but when it is verifying a log in its not case sensitive anymore and so it just looks for the first michelle.

How do I change it so that its not case sensitive?  So that it woudln't allow a michelle and a Michelle?

Here is the part of the script that creates a new user:

________________________________________________________


  'Build connection
 set conn = server.CreateObject ("ADODB.Connection")
 conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\home\Default\**********************"
 set rs = server.CreateObject ("ADODB.Recordset")
 'Open all records
 rs.Open "SELECT * FROM admin", conn, 3, 3
   
 'Check if username doesn't already exist
 do while not rs.EOF
  if rs("username")=username then
   set rs=nothing
   set conn=nothing
   Response.Redirect("taken.asp")
  end if
  rs.MoveNext
 loop

_________________________________________________________

Please help me! 
Thanks so much for reading

Loadsa love,
Vicky xxx

Back to Top
ultramods View Drop Down
Groupie
Groupie
Avatar

Joined: 08 January 2003
Location: Scotland
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote ultramods Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2003 at 6:33am

You could only allow users to have lower case usernames.

For example

username="ULTRAMODS"

RESPONSE.WRITE(LCase(username))

would change username to ultramods

Back to Top
vicky_c View Drop Down
Newbie
Newbie


Joined: 14 March 2003
Location: Scotland
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote vicky_c Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2003 at 6:42am

thanks for the fast reply!  but I guess that wouldn't really work since I already have hundreds of members in the database

How could I change it so that when it was verfiying it remained case sensitive?

Here is the verifying part of the script:

__________________________________________________________

'Build connection with database
 set conn = server.CreateObject ("ADODB.Connection")  
 conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\home\Default\*******************************"
 set rs = server.CreateObject ("ADODB.Recordset")  
 rs.Open "SELECT * FROM admin where username='"& username &"'", conn, 1

__________________________________________________________

Thanks so much!

Back to Top
ultramods View Drop Down
Groupie
Groupie
Avatar

Joined: 08 January 2003
Location: Scotland
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote ultramods Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2003 at 7:20am

when users are actually loggin in you would be using a query such as: "SELECT * FROM admin where username='"& username &"' AND password=' " & password " ' ",

The chances of lets say Michelle and michelle having the same password of birkett1 are quite slim. So this would be ok for your already registered members. But then you could use LCase() to make sure all new usernames are all lower case

It would be possible to check for a difference between michelle and Michelle howerver it means more coding, which thenresults in slower loading times.

Back to Top
ultramods View Drop Down
Groupie
Groupie
Avatar

Joined: 08 January 2003
Location: Scotland
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote ultramods Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2003 at 7:45am

OK if you want to do it the way you first said you could try using.

'Build connection
 set conn = server.CreateObject ("ADODB.Connection")
 conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\home\Default\**********************"
 set rs = server.CreateObject ("ADODB.Recordset")
 'Open all records
 rs.Open "SELECT * FROM admin where username= " & username & " ' " ", conn, 3, 3 


   
IF rs.EOF THEN                                                             

        RESPONSE.WRITE("yes you can have that username")

ELSE

          RESPONSE.WRITE("sorry username taken")

END IF

If Michelle is registered it wont allow michelle to be registered.

Back to Top
vicky_c View Drop Down
Newbie
Newbie


Joined: 14 March 2003
Location: Scotland
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote vicky_c Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2003 at 7:48am

Thanks soooooo much!  You're my saviour!!!!

I'm just gonna go try that just now!!!

Mwah! xxx

Loadsa love,
Vicky  xxx

Back to Top
vicky_c View Drop Down
Newbie
Newbie


Joined: 14 March 2003
Location: Scotland
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote vicky_c Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2003 at 8:58am

Ok, I tried both methods and neither worked...I keep getting error messages.  I must be doing something wrong   for the first method when logging in and you search for the username and password, wot would the next line be after

"SELECT * FROM admin where username='"& username &"' AND password1=' " & password1 " ' ",

just now i have:

If not rs("username") = username AND rs("password1") = password1 then
  rs.close
  conn.close
  set rs=nothing
  set conn=nothing
  Response.Redirect("login_id.asp")
 end if

 

can u see where I have gone wrong?

Thanks for your help I really appreciate it!

 

Back to Top
ultramods View Drop Down
Groupie
Groupie
Avatar

Joined: 08 January 2003
Location: Scotland
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote ultramods Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2003 at 9:13am

IF not rs.EOF  THEN

Response.Cookies("userLoggedIN") = username 

Response.redirect("loggedin.asp")

Else

        Response.redirect("login_id.asp")

END IF

rs.close
set rs=nothing

conn.close
set conn=nothing



Edited by ultramods
Back to Top
 Post Reply Post Reply Page  123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.