Click to See Complete Forum and Search --> : SQL Field Error...


Leo Koach
January 11th, 2000, 07:54 PM
Here is a tip.

Public Sub RepairModule()
' Leo Koach (1999)
' This module takes out the "'" for SQL searches.
X = 0
Do
X = InStr(X + 1, inp, "'")
If X = 0 Then Exit Do
inp = Left(inp, X) & "'" & Right(inp, Len(inp) - X) ' inp = <text>
X = X + 1
Loop
End Sub

At least this is the way I do it.

Antbody has better ideas?

www.openplace.com

Crazy D @ Work
January 12th, 2000, 01:45 AM
Use the VB6 Replace$ function and replace ' with '' that way the query will work.

Crazy D @ Work :-)

Lothar Haensler
January 12th, 2000, 01:45 AM
if you are trying to replace single quotes with two single quotes:

search = replace(search, "'", "''")



requires VB 6

Lothar Haensler
January 12th, 2000, 01:53 AM
cool, same answer at the exact same time! :-)

Leo Koach
January 12th, 2000, 06:33 AM
I wrote lots of programs I even sold most of them, I considered myself a professional, but...
The small things like that make me think. I know too little.
I have long ways to go still.

Thanks friends.

Leo