G
Guest
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], , [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
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], , [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