VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



An simple function to handle SQL strings that include a single apostrophe.

by Dennis Pettus (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 3rd December 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

An simple function to handle SQL strings that include a single apostrophe.

Rate An simple function to handle SQL strings that include a single apostrophe.



Dim strFind As String
Dim strReplace As String

  On Error GoTo HandleError:

  strFind = "'"
  strReplace = "''"
  SQLTextPrep = Trim(Replace(strStringIn, strFind, strReplace))
  
  Exit Function

HandleError:
   MsgBox "FUNCTION ERROR: SQLTextPrep " & Err.Number & " " & Err.Description
End Function


Download this snippet    Add to My Saved Code

An simple function to handle SQL strings that include a single apostrophe. Comments

No comments have been posted about An simple function to handle SQL strings that include a single apostrophe.. Why not be the first to post a comment about An simple function to handle SQL strings that include a single apostrophe..

Post your comment

Subject:
Message:
0/1000 characters