Board index » delphi » SQL statement with "#"

SQL statement with "#"

Hi, I'm working with Delphi 3 and SQL Server, I've a problem with the
character # In the tables of the database there are attributes with this
character # but when I want to use a query with # I get an error that I can
not use #. So is there an other solution to this problem without changing all
the attribute names in the Database? and is there a solution to that problem
in Delphi 4. Thanks, Ali.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

 

Re:SQL statement with "#"


Hello,
I've found the solution to my problem,
Thanks.

In article <6smnqd$31...@nnrp1.dejanews.com>,

Quote
  ali_...@my-dejanews.com wrote:
> Hi, I'm working with Delphi 3 and SQL Server, I've a problem with the
> character # In the tables of the database there are attributes with this
> character # but when I want to use a query with # I get an error that I can
> not use #. So is there an other solution to this problem without changing all
> the attribute names in the Database? and is there a solution to that problem
> in Delphi 4. Thanks, Ali.

> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Re:SQL statement with "#"


Try to enclose the field name in square brackets, or single quotes or
double quotes. It depends on the database.

Ex.
SELECT
  "Item_#" /* or 'Item_#' or [Item_#]
FROM
  Items

Quote
ali_...@my-dejanews.com wrote:

> Hi, I'm working with Delphi 3 and SQL Server, I've a problem with the
> character # In the tables of the database there are attributes with this
> character # but when I want to use a query with # I get an error that I can
> not use #. So is there an other solution to this problem without changing all
> the attribute names in the Database? and is there a solution to that problem
> in Delphi 4. Thanks, Ali.

> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Other Threads