UseQuoteChar not working in Kylix
Posted: Wed 08 Aug 2012 09:32
Hi,
I'm trying to use the firebird dbexpress driver for Kylix but I've hit a problem. We have a core table called ORDER which I realise is a reserved word and a very poor choice but that's a legacy issue I have to work around.
I can't get the driver to quote the table name. Monitoring the connection it's clearly stripping the " quotes I would normally type in the command text and I've not been able to force quoting on using the SetOptions method. (Code below with my other options selected for compatibility with the standard driver)
-----
procedure TForm1.SQLConnection3AfterConnect(Sender: TObject);
const
coUseQuoteChar = TSQLConnectionOption(202); // boolean
coBooleanDomainFields = TSQLConnectionOption(402); // boolean
coLongStrings = TSQLConnectionOption(101); // boolean
coOptimizedNumerics = TSQLConnectionOption(401); // boolean
begin
with TSQLConnection(Sender) do
begin
SQLConnection.SetOption(coUseQuoteChar,Integer(True) );
SQLConnection.SetOption(coBooleanDomainFields, Integer(False));
SQLConnection.SetOption(coLongStrings, Integer(False));
SQLConnection.SetOption(coOptimizedNumerics, Integer(False));
end;
end;
-----
I'd seen references to checking the quote character using the metadata property of the TCDSQLConnection but I don't seem to have that component available.
Any pointers greatly appreciated.
I'm trying to use the firebird dbexpress driver for Kylix but I've hit a problem. We have a core table called ORDER which I realise is a reserved word and a very poor choice but that's a legacy issue I have to work around.
I can't get the driver to quote the table name. Monitoring the connection it's clearly stripping the " quotes I would normally type in the command text and I've not been able to force quoting on using the SetOptions method. (Code below with my other options selected for compatibility with the standard driver)
-----
procedure TForm1.SQLConnection3AfterConnect(Sender: TObject);
const
coUseQuoteChar = TSQLConnectionOption(202); // boolean
coBooleanDomainFields = TSQLConnectionOption(402); // boolean
coLongStrings = TSQLConnectionOption(101); // boolean
coOptimizedNumerics = TSQLConnectionOption(401); // boolean
begin
with TSQLConnection(Sender) do
begin
SQLConnection.SetOption(coUseQuoteChar,Integer(True) );
SQLConnection.SetOption(coBooleanDomainFields, Integer(False));
SQLConnection.SetOption(coLongStrings, Integer(False));
SQLConnection.SetOption(coOptimizedNumerics, Integer(False));
end;
end;
-----
I'd seen references to checking the quote character using the metadata property of the TCDSQLConnection but I don't seem to have that component available.
Any pointers greatly appreciated.