Tmytable and dbgrid Delphi2005

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
steveastrouk
Posts: 6
Joined: Sun 29 Jan 2006 23:47

Tmytable and dbgrid Delphi2005

Post by steveastrouk » Tue 21 Mar 2006 23:14

Hi,
I have a small table, with six records like this

CREATE TABLE `uhtvisc`.`calgraphtable` (
`speed` double NOT NULL default '0',
`torque` double NOT NULL default '0',
`index` int(10) unsigned NOT NULL auto_increment,
PRIMARY KEY (`index`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

...linked into a Tmytable then a Tdatasource into a Delphi Tdbgrid. For the sake of the experiment, I use a DBnavigator to add and post data.

I can add NULL records, and post them no problem, but I can't add any real data though without an error:

---------------------------
Debugger Exception Notification
---------------------------
Project FGviscometer.exe raised exception class EMySqlException with message '
#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 'index = 3' at line 5'.


WHAT SQL ? at this point,I haven't added any yet !


The aim of the table is that I set up a series of speed entries, then read a value for torque, open the table for edit at a given speed entry and set the torque value in the record.

I'd be very grateful for any help please.

Thanks

Steve

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 22 Mar 2006 13:35

You try using reserved word 'index' as field name. To avoid this problem you should set option QuoteNames to true.

Guest

Thanks

Post by Guest » Wed 22 Mar 2006 13:53

Antaeus wrote:You try using reserved word 'index' as field name. To avoid this problem you should set option QuoteNames to true.
THANKS very much

I'll try it again as soon as

Steve

Post Reply