If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
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, 04: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, 01:45
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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, 02: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 02:44.
Reply With Quote
  #4 (permalink)  
Old 06-04-04, 03:04
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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, 20: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, 20:47
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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, 00:11
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
Thanx friend
Reply With Quote
  #8 (permalink)  
Old 06-08-04, 00:23
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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, 00:39
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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

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