|
-
Sep 6th, 2003, 12:18 PM
#1
Thread Starter
Addicted Member
String problem. simple 4 u but
Dear all
strSQL = "associate_name = '" & Text2.Text & "'"
rst.find strSQL
gives an error bcoz Text2.text contain
JOHN'S CLINIC
It contains an apostrophy.
How to deal with this.
urgent pls
thanx
-
Sep 6th, 2003, 02:00 PM
#2
I guess you can add \ before ' so you don't get that error. I'm not sure if it's that character though... I'm no expert with SQL, but this is a little thing I remember from somewhere...
The string would be then JOHN\'S CLINIC
-
Sep 6th, 2003, 02:03 PM
#3
I don't know if this works but try
strSQL = "associate_name = '[" & Text2.Text & "]'"
-
Sep 6th, 2003, 02:14 PM
#4
Thread Starter
Addicted Member
Martin / Merri
both does not work.
some one urgent pls.
-
Sep 6th, 2003, 02:16 PM
#5
Thread Starter
Addicted Member
And the value in Text2.text is from the Table.
So do not know how many times apostrophy is there and which place.
Though this can be found out, it will be troublsome.
Any simpler solution for this?
-
Sep 6th, 2003, 02:18 PM
#6
Ok, try to convert it with %27 (which is the character code for ' - I don't know if SQL supports quoted printable coding though... (this is used in the HTML-urls)
-
Sep 6th, 2003, 02:23 PM
#7
Dim strName As String
strName = Replace(Text2.Text, "'", "''")
strSQL = "associate_name = '" & strName & "'"
-
Sep 6th, 2003, 02:25 PM
#8
Thread Starter
Addicted Member
Its resolved
strFind= Replace(Text2.text, " ' ", " ' ' " )
strSQL = "associate_name = '" & strFind & "'"
rst.find strSQL
-
Sep 6th, 2003, 02:26 PM
#9
Thread Starter
Addicted Member
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
|