> The query below will return a match without regard to the case
>
> "password" in the database returns a record when matched with
> "PASSWORD" or "PaSSwORd" when I want
> it to return a record with "password" exactly.
>
> How can I force a case sensative query?
>
> <CFQUERY NAME="login" DATASOURCE="datasourse">
> SELECT Count(*) AS loggedin
> FROM admin_pass
> WHERE username = '#trim(FORM.username)#'
> AND password = '#trim(FORM.password)#'
> </CFQUERY>

I can tell you how this works in SQL Server; when you install SQL Server, it
asks you what sort order to use. You can then pick case-sensitive
or -insensitive. If you want to change later, you have to reinstall SQL
Server and rebuild all your databases. The default is case-insensitive.

So, if you had a default SQL Server install, you'd have to do a lot of work
with string functions to make this happen. For example, within your SQL you
could retrieve all the records that have a simple string match, then loop
over each returned record, and within that loop have a nested loop that
examines each string character-by-character. Alternatively, you could do
that within CF.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to