Page 1 of 1

Tmytable and dbgrid Delphi2005

Posted: Tue 21 Mar 2006 23:14
by steveastrouk
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

Posted: Wed 22 Mar 2006 13:35
by Antaeus
You try using reserved word 'index' as field name. To avoid this problem you should set option QuoteNames to true.

Thanks

Posted: Wed 22 Mar 2006 13:53
by Guest
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