Help with 'cannot use parens' error 
Author Message
 Help with 'cannot use parens' error

Does anyone know how to get around having apostrophe's in a string that gets
passed to an Access database via SQL?

If I try to replace a single ' with a double ' using this line of code:
Replace(myString, " ' "," ' ' ")

I get an error saying :
Microsoft VBScript compilation error '800a0414'
Cannot use parens when calling a Sub

Any help with this is appreciated.

Isa



Fri, 01 Sep 2000 03:00:00 GMT  
 Help with 'cannot use parens' error

1) I don't think your replace string can be larger than the string
being replaced...

2) The original string isn't changed, the function returns a string
with the changes

3) because you aren't storing the return value - like this:
replacement=replace(myString,"x","y")
vbscript thinks you are calling a subroutine, not a function, and you
aren't supposed to use parenthesis when calling a subroutine, hence
the error message....

Hope this sorts out your problem...
-Heidi

Quote:

>Does anyone know how to get around having apostrophe's in a string
that gets
>passed to an Access database via SQL?

>If I try to replace a single ' with a double ' using this line of
code:
>Replace(myString, " ' "," ' ' ")

>I get an error saying :
>Microsoft VBScript compilation error '800a0414'
>Cannot use parens when calling a Sub

>Any help with this is appreciated.

>Isa




Sat, 02 Sep 2000 03:00:00 GMT  
 Help with 'cannot use parens' error

Try:

myString = Replace(myString, etc...)

Neil Henderson
--

Quote:

>If I try to replace a single ' with a double ' using this line of code:
>Replace(myString, " ' "," ' ' ")

>I get an error saying :
>Microsoft VBScript compilation error '800a0414'
>Cannot use parens when calling a Sub



Sat, 02 Sep 2000 03:00:00 GMT  
 Help with 'cannot use parens' error

Or just remove the paranthesis ().  You don't need them unless your using
CALL.  Then the parameters must be included, and VB likes to see the () at
that time.


Quote:
>Try:

>myString = Replace(myString, etc...)



Wed, 06 Sep 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Error:Cannot use parens when call Sub HELP

2. Run-time error '-2147221231 (80040111)': Automation error ClassFactory cannot supply requested class

3. ASP ERROR: 'Cannot use parens when calling a Sub'

4. HELP: Cannot use parens when calling sub.

5. '' Cannot be loaded - HELP

6. Beginner's postscript question with parens

7. Help - VBScript runtime error '800a0005'

8. Run-time error '91' - HELP

9. Help!!!: Errors with 'MSComDlg.CommonDialog'

10. HELP needed with 'eoclip' error message

11. Runtime error ''800a01b6''

12. error 'ASP 0115' Unexpected error

 

 
Powered by phpBB® Forum Software