Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Login problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-03-04, 05:00
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
Login problem

Hi there,

I got one prob during my login session.
I'm using ASP and Access as my database.....................
In my login page, i have 2 textbox which will accept username and password respectively.
when i key in the username, it basically will accept capital and non-capital word with the password being true.
How do i change it so that when user key in the username, it will accept only particular case which is very much similar to the username in the database.
In other word, i want it to be case sensitive.
Can anyone help me?
Thanx
Reply With Quote
  #2 (permalink)  
Old 06-04-04, 02:45
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
What is doing the comparison to check these things?? The database or the script? In whatever case are you using a function or sql script or what??

It can definately be changed, but how depends on how you are doing it now.
Reply With Quote
  #3 (permalink)  
Old 06-04-04, 03:41
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
hi there,
actually, my asp script will do the comparison instead of the sql statement.the sql statement is just to retrieve the data only which are the username and password.
i'm not using any function to do this process coz i'm keeping it simple.
thanx

Last edited by michaelfg81 : 06-04-04 at 03:44.
Reply With Quote
  #4 (permalink)  
Old 06-04-04, 04:04
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
so what function are you using to compare the strings?? or are your just going myPassword == dbPassword??

in theory you should find the if myPassword = "abcd" and dbPassword = "ABDC" then myPassword == dbPassword should return false.

(where == is comparison and = is assignment).

You could use the StrComp function if you wanted.. that might help...
Reply With Quote
  #5 (permalink)  
Old 06-07-04, 21:07
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
hi there,

actually i'm using SQL statement to compare..........
and the code is like this

sqlCode="Select name FROM register WHERE password= '" + pswd + "' and username = '" + userID + "'"
Set rs=db.Execute(sqlCode)

if rs.EOF then
session("statusUser")="KO"
response.Redirect("login.asp")
response.End()
else
session("statusUser")="OK"
session("username")=rs("name")
response.Redirect("index.asp")
end if
what do u think?
Reply With Quote
  #6 (permalink)  
Old 06-07-04, 21:47
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
Ahhh,... okie,.. then you probably have an issue with you default collation setups (I think that is the right phrase).

Basically you can set databases and db servers to be case sensitive or case insensitive (also accent sensitive and something else).

It looks like your database/server has been set up as case insensitive. Probably best to put a post into the applicable database forum and find our how you can fix this.
Reply With Quote
  #7 (permalink)  
Old 06-08-04, 01:11
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
Thanx friend
Reply With Quote
  #8 (permalink)  
Old 06-08-04, 01:23
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
Hang on,.. you are using Access right? Perhaps you could right a function to do the check for you? I had a look at the Access help and couldn't see an obvious way to made the db case sensitive.
Reply With Quote
  #9 (permalink)  
Old 06-08-04, 01:39
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
something like this might work....

SELECT temp.field1
FROM temp
WHERE ((StrComp([field1],"username",0)="0")) and ((StrComp([field2],"password",0)="0"))

I tried it in a little access db and it seemed to work....
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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