How to get TMyLoader to quote the field names?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
skirsche
Posts: 8
Joined: Fri 03 Apr 2009 06:59

How to get TMyLoader to quote the field names?

Post by skirsche » Thu 29 Jul 2010 13:06

If I try to use a TMyLoader (5.90.0.58) to fill a table that contains a column called "Select" it raises an EMyError like this one:

#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Select, Text1, Text2) VALUES (NULL, '1', '1', 'abc1', 'abc2', 'abc3'' at line 1'

There is TMyQuery.Options.QuoteNames, but how do I tell a TMyLoader to quote the field names when generating SQL?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 29 Jul 2010 14:28

To solve the problem you should quote the column name for appropriate field using the TLoader.Columns property.

Code: Select all

  MyLoader.Columns.Items[1].Name := '`SELECT`';

Post Reply