Runtime error 3077 
Author Message
 Runtime error 3077

This should work...

Public Function FixQuotes(ByVal sLine As String) As String
'Purpose:   This function solves the problem of single _
            quotes internal to a long string.  .findfirst _
            and other sql'ers have problems w/ parsing '
'Date:      Scammed from newsgroup by dpp 1/27/97
'--------------------------------------------------------------------
'Author:    Kevin Patz  (public domain -in newsgroup)
'Original   Turns a single quote in a string into two consecutive _
  Purpose   single quotes (to get through SQL parser)
'********************************************************************

Dim i As Integer, j As Integer
i = 1
j = InStr(i, sLine, "'")            ' Find the first quote
Do Until j = 0
  sLine = Left$(sLine, j) + MID$(sLine, j)   ' Double it up
  i = j + 2             ' Find the next quote
  j = InStr(i, sLine, "'")
Loop
FixQuotes = "'" & RTrim$(sLine) & "'"   ' Wrap the whole thing in quotes

End Function



Sun, 13 Feb 2000 03:00:00 GMT  
 Runtime error 3077

With VB5.0 when trying to findfirst or findnext on an input such as
o'rielly in a textbox control bound to field in an access 97 table
I get an error (appears to be the apostrophe) - runtime error 3077;
syntax error (missing operator) in expression.

Would appreciate ideas to overcome, need to accept input such as
usernames
with apostrophe and possibly other special characters

Thanks - Ray Brickhill



Sun, 13 Feb 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Run-time error 3077 - Find Records Combo Box

2. Error 3077

3. 3077 Error

4. Syntax Error #3077 - Please Help!!!!

5. Syntax error 3077

6. Trying to run mdb using A2K Runtime generates runtime error

7. Runtime error '429' at runtime

8. Runtime error '429' at runtime

9. Runtime error '429' at runtime

10. Runtime Error/Automation Error :-(

11. runtime error '3421' datatype convertion error

12. Help with Error on test program - Runtime Error 10048

 

 
Powered by phpBB® Forum Software