Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 16th, 2006, 05:18 AM
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to check the password field for case-sensitive

Hi friends...

    I am developing an ASP.NET web application with MS-ACCESS as
backend. For which i have
a login page where i have to validate user name and password. My doubt is
how to Check passowrd field
case sensitiveness with MS-ACCESS . Please send me solution..


Reply With Quote
  #2 (permalink)  
Old January 16th, 2006, 12:24 PM
Imar's Avatar
Wrox Author
Points: 67,332, Level: 100
Points: 67,332, Level: 100 Points: 67,332, Level: 100 Points: 67,332, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,231
Thanks: 66
Thanked 1,418 Times in 1,398 Posts
Default

Quick question before I answer this one: Is there any reason why you're not using the new ASP.NET 2.0 Login controls that work with SQL Server Express and SQL Server?

Why develop your own login mechanism when you have all the tools for authentication available out of the box?

That said, take a look at StrComp. It's used compare strings. As an optional parameter, you can set options for how the compare is performed. 0 is a binary compare, which means it's case sensitive:

SELECT 1 FROM Members
WHERE StrComp(Members.Password, @password, 0) = 0

If the StrComp returns 0, it means Members.Password equals @password.

http://msdn.microsoft.com/library/de...fctstrcomp.asp

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old January 31st, 2011, 02:44 PM
Registered User
 
Join Date: Jan 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Help With Vb 2008 and Ms Access 2010

Hi I have a problem where I am
designing a VB 2008 project with Ms Access 2010 as a Database Management program, I have created a login form and it works well but it is not case sensitive :O Here is my code:

Imports System.Data
Imports System.Data.OleDb

Public Class LogIn
Public accConnection As New OleDbConnection

Dim strConnectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;
Data Source = C:\Users\Jack\Documents\College
Work\Computing\A2\Coursework\Computer Work\Database\HFDB.accdb;Persist
Security Info=False;"

Private Sub Login_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strConnectionString As String =
"Provider=Microsoft.ACE.OLEDB.12.0; Data Source =
C:\Users\Jack\Documents\College Work\Computing\A2\Coursework\Computer
Work\Database\HFDB.accdb;Persist Security Info=False;"

accConnection = New OleDbConnection(strConnectionString)
Try
accConnection.Open()
Catch oleDbExceptionErr As OleDbException
MessageBox.Show(oleDbExceptionErr.Message, "Access Error1")
Catch InvalidOperationExceptionErr As InvalidOperationException
MessageBox.Show(InvalidOperationExceptionErr.Messa ge, "Access
Error2")
End Try

If accConnection.State <> ConnectionState.Open Then
MessageBox.Show("Database Connection Failed!")
Exit Sub
End If
End Sub


Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdLogin.Click
Dim cmdString1 As String = "SELECT Login_Username, Login_Password "
& "FROM Login "
Dim cmdString2 As String = "WHERE (Login_Username = @Username) AND
(Login_Password = " & "@Password) "

Dim cmdString As String = cmdString1 & cmdString2
Dim accCommand As New OleDbCommand
Dim accDataReader As OleDbDataReader
Dim SelForm As New MainPage


accCommand.Connection = accConnection
accCommand.CommandType = CommandType.Text
accCommand.CommandText = cmdString
accCommand.Parameters.Add("@Username", OleDbType.Char).Value =
txtUsername.Text
accCommand.Parameters.Add("@Password", OleDbType.Char).Value =
txtPassword.Text
accDataReader = accCommand.ExecuteReader

If accDataReader.HasRows = True Then
MessageBox.Show("Login Was Successful!")
SelForm.Show()
Me.Hide()
Else
MessageBox.Show("No Matching Username And Password Found")
End If

accDataReader.Dispose()
accDataReader = Nothing
accCommand.Dispose()
accCommand = Nothing
End Sub

Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdCancel.Click
accConnection.Close()
accConnection.Dispose()
accConnection = Nothing
Me.Close()
End Sub

Can anybody help me by letting me know how I can make this case sensitive!
Any help is greatly appreciated :D
Thanks
Reply With Quote
  #4 (permalink)  
Old February 1st, 2011, 02:37 AM
Imar's Avatar
Wrox Author
Points: 67,332, Level: 100
Points: 67,332, Level: 100 Points: 67,332, Level: 100 Points: 67,332, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,231
Thanks: 66
Thanked 1,418 Times in 1,398 Posts
Default

Hi Jack,

Take another look at my original post you replied to. It shows you how to alter your WHERE clause to make it case sensitive. I don't see that in your current WHERE clause and since Access by default queries in a case insensitive way, your password check is currently case insensitive.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


Thread Tools
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Case sensitive search prabodh_mishra SQL Server 2000 6 June 10th, 2008 04:54 AM
Case Sensitive hymavathy_kr VB Databases Basics 1 August 10th, 2007 06:43 AM
making login case sensitive with mysql database crmpicco MySQL 0 August 18th, 2006 05:48 AM
How to do case sensitive comparison in SQL SERVER leo_vinay Classic ASP Databases 2 January 24th, 2005 12:46 PM
Check Case in a Case-Insensitive DB nbryson SQL Language 1 January 23rd, 2004 06:36 AM



All times are GMT -4. The time now is 04:25 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.