writing inputtext to a databasetable, using SQL-statements

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In a windowsform an inputtext is written (SQL-statement) in a database table.
Everything works fine until the user gives a special sign f.e. a quote (')
in. What can I do to resolve this problem?
 
Nicole,

Just before you issue the SQL statement, do this:

Replace(SQL, "'", "''") ' replace any single quote with two single quotes

Hope this helps
Ad.
 
You can use parameter for command text or use two quote (''). The first quote
can escape the second one.

HTH

Elton Wang
(e-mail address removed)
 
Back
Top