Results 1 to 2 of 2

Thread: Accepting Single Qoute ( ' )

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Philippines
    Posts
    7

    Unhappy Accepting Single Qoute ( ' )

    How to save the data containing a single qoute?

    or

    How to eliminate the error for saving containing a Single Qoute? ( ' ) record?
    Formalejo, Francis M.

  2. #2
    pvb
    Guest
    before passing your sql statement off to the database pass the statement to the following function to replace all occurences of individual single quotes with two single quotes:

    Code:
    Function SafeSQL(ByVal sCommandText As String) As String
        SafeSQL = Replace$(sCommandText, "'","''")
    End Function
    Example:
    Code:
    sYourSqlStatementVar = SafeSQL(sYourSqlStatementVar)
    Or:
    Code:
    oRecordset.Open SafeSQL(YourSqlStatement)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width