|
-
Jul 12th, 2000, 06:33 PM
#1
Thread Starter
Hyperactive Member
Is it possible to make a SELECT statment case-sensitive? For example, is it possible to have a statment like
Code:
rsCountry.Open "Select * From Countries Where COUNTRY = '" & txtCountry.text & "'", myCN, adOpenKeyset, adLockReadOnly
where, if txtCountry.text = 'France', the recordset would return 'France' but not 'FRANCE'?
-
Jul 12th, 2000, 06:50 PM
#2
Hyperactive Member
Yes there is.
You need to compare the ACTUAL values of the characters rather than the symbolic fact of what letter it is.
Therefor you need to convert the things you are comparing to a variable length BINARY field (The equivalent of comparing actual ASCII values instead of letters)
Code:
rsCountry.Open "Select * From Countries Where CONVERT(varbinary,COUNTRY) = CONVERT(varbinary,'" & txtCountry.text & "')", myCN, adOpenKeyset, adLockReadOnly
-
Jul 12th, 2000, 07:10 PM
#3
Thread Starter
Hyperactive Member
Gen-X, I tried your example. The recordset is actually a table of previously used passwords, so the recordset looks like:
Code:
rsPasswords.Open "Select * From Passwords Where IdUSUARIO = " & _
rsUsers.Fields("IdUSER").Value & " And CONVERT(varbinary, PASSWORD) = CONVERT(varbinary, '" & _
txtPassword(1).Text & "')", myCN, adOpenKeyset, adLockReadOnly
But it gives me the error that the function CONVERT is not defined in the expression.
-
Jul 12th, 2000, 08:36 PM
#4
Hyperactive Member
Sounds like you are not using SQL Server but perhaps Access or something else.
In that case you have to find a similar function in the SQL help of the database you are using that allows you to convert between datatypes.
You want to get away from strings and into a format that is binary in nature so that you compre the actual values and not the string "logical" values.
-
Jul 13th, 2000, 08:39 AM
#5
Thread Starter
Hyperactive Member
YOu are right, I am using Access. There is probably some similiar function in Access, though, so I will check the Help sections.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|