Question
How to get exact match in SELECT
I am new to coldfusion and am coming from a VBScript/ASP
background using MySQL.
In this project I am doing I need to use MS Access. I have a table with a 50 character text field that contains a randomly generated "code" such as 8LGfkOsLrBKOaKJZo3fxglKSpBGydxKou66x9qF6LIPQIJLxfe.
I need to do an exact match on that code using MS Access and SELECT. I have a function thats purpose to see if the code already exists in the table. The is as follows:
<cffunction name="IsJobKeyUnique" access="public" returntype="boolean" output="false">
<cfargument name="jk" type="string" required="yes">
<cfset ret=True>
<cfquery name="temp" datasource="lrs">
SELECT * FROM jobkeys WHERE jobkey="#ARGUMENTS.jk#"
</cfquery>
<cfdump var="temp">
<cfif temp.RecordCount NEQ 0>
<cfset ret=False>
</cfif>
<cfreturn ret>
</cffunction>
However, the query is not case sensitive. In testing, I changed the last to characters from "fe" to "FE" and it still determines the strings to be equal.
I checked in MS Access to see if I could change the field type of BINARY or soemthing other than simply text but didn't see any options to do so.
Any help would be appreciated.
In this project I am doing I need to use MS Access. I have a table with a 50 character text field that contains a randomly generated "code" such as 8LGfkOsLrBKOaKJZo3fxglKSpBGydxKou66x9qF6LIPQIJLxfe.
I need to do an exact match on that code using MS Access and SELECT. I have a function thats purpose to see if the code already exists in the table. The is as follows:
<cffunction name="IsJobKeyUnique" access="public" returntype="boolean" output="false">
<cfargument name="jk" type="string" required="yes">
<cfset ret=True>
<cfquery name="temp" datasource="lrs">
SELECT * FROM jobkeys WHERE jobkey="#ARGUMENTS.jk#"
</cfquery>
<cfdump var="temp">
<cfif temp.RecordCount NEQ 0>
<cfset ret=False>
</cfif>
<cfreturn ret>
</cffunction>
However, the query is not case sensitive. In testing, I changed the last to characters from "fe" to "FE" and it still determines the strings to be equal.
I checked in MS Access to see if I could change the field type of BINARY or soemthing other than simply text but didn't see any options to do so.
Any help would be appreciated.
