use the CSQL function
here is the definition:
VB Code:
Public Function CSQL(SQLCMD As String) If IsEmpty(SQLCMD) Or IsNull(SQLCMD) Then CSQL = "''" Else CSQL = "'" & Replace(SQLCMD, "'", "''") & "'" End Function
now with your insert statment go:
INSERT INTO Demo(notes) VALUES(" & CSQL(Text1.Text) & ")"
note: the csql will add the beginning ' and the end ' while replacing all other ' to '' making them a single quote inserted to the database.





Reply With Quote