PDA

Click to See Complete Forum and Search --> : help! case sensitive.


Namo
Sep 30th, 2000, 10:56 AM
Hello
When use SQL query agaisnt access DB it is NOT case sensitive for me.

example, lets say i have this record on the DB:

Name: Amir
Last Name: Gershman
Age: 27

Now i use this query against this table:

SELECT *
FROM Table_Name
WHERE Name = amIR

This WILL return me this record . i dont want this to come back,
I want it to be case sensitive.

How can i do it? please help :( .

btw - how is it working with sql server? what is the default? anything else i need to know?

Thanks ALOT.

Namo.

xmin
Sep 30th, 2000, 01:11 PM
Would you like to try this? But make sure of the result before you put it into actual use.

Code
-----------------------------------------------------------
Option Compare Binary
.
.
.
Set yourRecordSet = yourDatabase.OpenRecordset(¡°Select * From Table_Name Where Name = ¡®Amir¡¯;¡±, dbOpenDynaset)

With yourRecordSet
.MoveFirst
Do
If StrComp(!Name,¡±Amir¡±) <>0 Then .Delete
.MoveNext
Loop Until .EOF
End With
.
.
.
-----------------------------------------------------------
Visual Basic Professional 6.0

Namo
Sep 30th, 2000, 01:35 PM
What?
I dont understand what u mean..
Can u explain?

xmin
Sep 30th, 2000, 03:11 PM
I mean you can select all the Amirs, aMirs, amIRs... and then delete all that are not exactly Amir (With Option Compare Binary, the StrComp function is case sensitive). Isn't the rest what you want?
But don't update your recordset, or your table will be destroyed.
____________________________________________________________
Visual Basic Professional 6.0