|
-
Sep 30th, 2000, 10:56 AM
#1
Thread Starter
Member
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.
-
Sep 30th, 2000, 01:11 PM
#2
Addicted Member
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
-
Sep 30th, 2000, 01:35 PM
#3
Thread Starter
Member
What?
I dont understand what u mean..
Can u explain?
-
Sep 30th, 2000, 03:11 PM
#4
Addicted Member
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
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
|