473,466 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to make login script case sensitive

Joe
Hi,

I have a login script and right now it is not case sensitive. I want to make
it case sensitive. The userid and password is stored in MS Access DB and not
in web.config. Can someone give me some clue as how to do it?

I have pasted my code to give you an idea as what code I have. This code
works fine. I only want to make it case sensitive.

Thanks in advance

Joe

Dim DBConn As OleDbConnection
Dim DSLogin As New DataSet
Dim CmdStr As String
Dim DBCmd As New OleDbCommand
Dim DBSelect As New OleDbCommand
Dim pathStr As String
Dim dtrResults As OleDBDataReader
Dim TheDomain As String
Dim ThePath As String

pathStr = "E:\mole"
DBConn = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0; " _
& "DATA SOURCE=" _
& pathStr + "\databases\xyz.mdb")
DBConn.Open()

CmdStr =("Select userid, password from logins Where page = abc' AND
userid= @uid AND password = @Password")
DBSelect = new OleDbCommand(CmdStr, DBconn)
DBSelect.Parameters.Add("@uid", OleDbType.VarChar, 255)
DBSelect.Parameters("@uid").Value = txtUserID.Text
DBSelect.Parameters.Add("@Password", OleDbType.VarChar, 255)
DBSelect.Parameters("@Password").Value = txtPwd.Text
dtrResults = DBSelect.ExecuteReader()
if dtrResults.Read()
dtrResults.Close()
DBConn.Close()
lblMessage.Text = "Please enter correct login info."
Response.Redirect("wp_request.aspx?y=007")
else
dtrResults.Close()
CmdStr = "Insert into users ([name], [company], [email], [request_date],
[ip], [userid], [password]) values ('" & txtName.Text & "','" &
txtCompany.Text & "','" & txtEmail.Text & "','" & DateTime.Now() & "','" &
Request.UserHostAddress() & "','" & txtUserID.Text & "','" & txtPwd.Text &
"')"
DBCmd = New OleDbCommand(CmdStr, DBConn)
DBCmd.ExecuteNonQuery()

DBConn.Close()

TheDomain = ".www.something.com"
ThePath = "/somefoldeer"
Response.Cookies("Somecookie").Value = txtName.Text '("ID")
Response.Cookies("Somecookie ").Expires = DateTime.Now.AddDays(1)
'DateAdd("d", 1, Now()) '#Dec 31, 2004#
Response.Cookies("Somecookie").Domain = TheDomain
Response.Cookies("Somecookie").Path = ThePath

Response.redirect("constructor.aspx?y=")
End If

Nov 18 '05 #1
1 3500
Access comparisons are case insensitive. To do a case sensitive
comparison, use the STRCOMP() function:

CmdStr =("Select userid, password from logins Where page = abc' AND
STRCOMP(userid,@uid,0)=0 AND STRCOMP(password,@Password,0)=0")

http://msdn.microsoft.com/library/de.../D6/S5B2B8.asp

The third parameter in STRCOMP can be 0,1,2; 0 means binary compare so
it will be a case sensitive match. Return of 0 means the first two
parameters are equal.

- Jon
http://weblogs.asp.net/jgalloway

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: WindAndWaves | last post by:
Hi Gurus I am keen to make a search page on a website, but I have absolutely zero experience with PHP. I am going to hire an expert, but I thought that it may pay to try it a bit first myself...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
6
by: Ian Boyd | last post by:
Every time during development we had to make table changes, we use Control Center. Most of the time, Control Center fails. If you try to "undo all", it doesn't, and you end up losing your identity...
0
by: John Meyer | last post by:
index: <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDb" %> <!DOCTYPE html PUBLIC...
1
by: xcelmind | last post by:
Hello Dev. Guru, I want to at this time introduce myself. I am Stanley Ojadovwa by name. I’m a freelance and a newbie in web application development. I’m currently using ASP as my application...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
5
by: YaoBao | last post by:
Is any ColdFusion script I can put on my webpage that will create a search bar so people can type keywords to match it on the current page in my website? It will be exactly like the finder search bar...
5
by: muppetjones | last post by:
I'm really new to the whole networking side of things, so I don't know the backend very well. I wrote a series of PHP/AJAX scripts to allow a user to create a login account, but apparently my script...
1
by: joshai | last post by:
Hi, I'm pretty new to the php/mysql world and am building an article database for a website with multiple content types. I have an entry screen built that allows the site owner to enter articles,...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.