The driver doesn't seem to like speech marks

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
ste
Posts: 8
Joined: Mon 31 Oct 2005 14:56

The driver doesn't seem to like speech marks

Post by ste » Mon 31 Oct 2005 15:00

I have come across a problem when using the data access components to run a query from my program (compiled in Delphi 6) to a SQL Server 2000 database.

It doesn't seem to like speech marks.

If my program tries to input 'the "C:\LFM9_Update" folder.' into a VARCHAR field using an insert statement, an error occurs. But the above query will run using Microsoft Query Analyser.

Could you please tell me how I could insert the above text into a varchar field?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 31 Oct 2005 16:08

Use parameters instead of writing explicit parameter values in SQL statement:

Code: Select all

SQL.Text := 'insert into SM_MATTER_EVENTS (QQQ) values (:QQQ)';
Params[0].AsString := 'C:\LFM9_Update';
Execute;

ste
Posts: 8
Joined: Mon 31 Oct 2005 14:56

Post by ste » Wed 02 Nov 2005 18:00

Thanks Ikar, that works

Post Reply