Board index » delphi » SQL Likes Bug with MSSQL 7 and spaces in field names

SQL Likes Bug with MSSQL 7 and spaces in field names

If a create a tquery with MSSQL 7 as the server with Quoted Fields on I get
an error when my Query is set to Live.
The tQuery sends over a select with all field names unquoted.

I have trued the following:
Q := '"';
R := DbiSetProp (HDBIObj(DB.Handle), dbQUOTECHAR, 34);

Still no luck.  The SQL monitor shows a select string going out without
quotes.

The Oracle will quote the strings.
Again this goes out when request live is true.

A quock way to test this is to try to view the table in Object Explorer and
you will get an error message.

--
Tim Smith
Porter Lee Corporation
Schaumburg, IL
USA
(847) 985-2060

 

Re:SQL Likes Bug with MSSQL 7 and spaces in field names


You should avoid table/field names with spaces.
But, if you really can't do otherwise, then you quote fields in SQL
statement. This server/client independent, will work with most.
For example, if you for some reason switch to a BDE replacement, you'll have
to recode all those "DbiSetProp". Also, DbiSetProp tries to set prop, but it
can be successfull or not, depending on next layer (ODBC or whatever).

--
----------------------
Regards
Robert Cerny
Remove both qwe when replying
email: robert.qwe.ce...@neosys.xrs.qwe.si

No questions via email, unless explicitly invited.

Quote
Tim Smith wrote in message <8ah525$n...@bornews.borland.com>...
>If a create a tquery with MSSQL 7 as the server with Quoted Fields on I get
>an error when my Query is set to Live.
>The tQuery sends over a select with all field names unquoted.

>I have trued the following:
>Q := '"';
>R := DbiSetProp (HDBIObj(DB.Handle), dbQUOTECHAR, 34);

>Still no luck.  The SQL monitor shows a select string going out without
>quotes.

>The Oracle will quote the strings.

>Again this goes out when request live is true.

>A quock way to test this is to try to view the table in Object Explorer and
>you will get an error message.

>--
>Tim Smith
>Porter Lee Corporation
>Schaumburg, IL
>USA
>(847) 985-2060

Other Threads