| |
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.
|
 |

06-03-04, 05:00
|
|
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
|
|

06-04-04, 02:45
|
|
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.
|
|

06-04-04, 03:41
|
|
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.
|

06-04-04, 04:04
|
|
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...
|
|

06-07-04, 21:07
|
|
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?
|
|

06-07-04, 21:47
|
|
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.
|
|

06-08-04, 01:11
|
|
Registered User
|
|
Join Date: Mar 2004
Posts: 202
|
|
|
|

06-08-04, 01:23
|
|
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.
|
|

06-08-04, 01:39
|
|
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....
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|