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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top