Page 1 of 1

The driver doesn't seem to like speech marks

Posted: Mon 31 Oct 2005 15:00
by ste
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?

Posted: Mon 31 Oct 2005 16:08
by Ikar
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;

Posted: Wed 02 Nov 2005 18:00
by ste
Thanks Ikar, that works