Forum Moderators: open
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''it's','8/7/2003 7:16:01 PM')'.
/socoolbrew/review.asp, line 102
I have tried the following:
Replace(formVar,"'",".")
But its doesn't seem to work as I get the following error:
Error Type:
Microsoft VBScript compilation (0x800A0414)
Cannot use parentheses when calling a Sub
/socoolbrew/review.asp, line 100, column 26
Replace(StrReview,"'",".")
-------------------------^
Any ideas guys?
function checkforbadchars(string)
if (instr(1, string, chr(34), 1)) > 0 '--- looks for "
inString = 1 '--- the character was found
elseif (instr(1, string, chr(44), 1)) > 0 '--- looks for ,
inString = 1
elseif (instr(1, string, chr(33), 1)) > 0 '--- looks for!
inString = 1
elseif (instr(1, string, chr(35), 1)) > 0 '--- looks for #
inString = 1
elseif (instr(1, string, chr(36), 1)) > 0 '--- looks for $
inString = 1
elseif (instr(1, string, chr(37), 1)) > 0 '--- looks for %
inString = 1
elseif (instr(1, string, chr(94), 1)) > 0 '--- looks for ^
inString = 1
elseif (instr(1, string, chr(38), 1)) > 0 '--- looks for &
inString = 1
elseif (instr(1, string, chr(42), 1)) > 0 '--- looks for *
inString = 1
elseif (instr(1, string, chr(40), 1)) > 0 '--- looks for (
inString = 1
elseif (instr(1, string, chr(41), 1)) > 0 '--- looks for )
inString = 1
elseif (instr(1, string, chr(61), 1)) > 0 '--- looks for =
inString = 1
elseif (instr(1, string, chr(43), 1)) > 0 '--- looks for +
inString = 1
else
inString = 0 '--- none of the characters are in your string
end if
checkforbadchars = inString '--- return the value
end function
then after your function completes, you can check to see if whatever = 1 or 0
hope this helps.
-Matt
Another approach would be create a string called "badchars" and implement a partial match function . Its something like below, not got time to think about it too much :)
HTH
function ispartialMatch (byval badchars,byval mystring)
result=false // assume failure
for i=0 to len(badchars)
for j=0 len(mystring)
if mid(badchars,i,1) = mid(mystring,j,1) then
ispartialMatch=true: exit for
end if
next:next:end function