Re: SQL statement contain " character



I am using the QuotedStr function. The SQL statement produced is valid - it is accepted if I execute it against SQL Server in Query Analyzer.

The problem is somewhere between my code and the database. Looking through the source for ADOdb.pas it appears that it is converting the statement to a parameterised statement. This is failing when the double quote is in there but works if it is taken out. It also works if I set ParamCheck to false.

I just want to know why

Dave

Brian Bushay TeamB wrote:
The problem character is a double quote, not 2 single quotes. It is used as an abbreviation for inches. Since the application is used by engineers, it occurs fairly often.

I tried doubling the double quote and also embedding it between single quotes. Neither worked.


Use the delphi QuotedStr function.

sql :=  QuotedStr('update TableName set TextField = Could not save with '' in')
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.



Relevant Pages

  • Re: Processing DynamicSQL with single quotes in the data
    ... However any varchar could have a quote in it - i.e. descriptions, ... Every SQL statement is being executed in C from a common handler OpenROAD procedure so ... It executes all non-SELECT statements with an EXEC SQL EXECUTE ...
    (comp.databases.ingres)
  • RE: Combo Box, filter values
    ... Try changing your last SQL statement to: ... That is after the word Like you'll see one apostroph an asterisk and double ... After the second & you'll find a double quote an asterisk a single ... so I want to search in my combobox. ...
    (microsoft.public.access.forms)
  • RE: does this sql capability exist
    ... more ways to dynamically create the SQL statement. ... what happens if you need to have a price for 1-25 items instead ... you convert the quote to a PO or create a separate PO later? ... I have 10 text boxes that represent 10 of the fields in my table ...
    (microsoft.public.access.formscoding)
  • Re: Processing DynamicSQL with single quotes in the data
    ... with its counterpart to the extend that you can substitute all quotes ... string back to your program so it might be better to do the processing ... However any varchar could have a quote in it - i.e. descriptions, ... Every SQL statement is being executed in C from a common handler OpenROAD procedure so ...
    (comp.databases.ingres)
  • Re: Create Table and Integer
    ... >Win2K, D7, ADO, Access DB ... >TABLE sql statement? ... Brian Bushay ...
    (borland.public.delphi.database.ado)