Unable to post when fieldname contains a period.
Posted: Thu 03 Sep 2009 13:26
Using Delphi 2009 and MySql Data Access components v. 5.80.0.48. I am unable to update when tablefieldname contains a period.
To reproduce:
CREATE TABLE `test` (
`ID` int(11) NOT NULL auto_increment,
`Field1` varchar(20) default NULL,
`Field.1` varchar(20) default NULL,
`Field1.` varchar(20) default NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
If posting to
1) Table.FieldbyName('Field1').AsString := 'Test'; -- this is ok
2) Table.FieldbyName('Field.1').AsString := 'Test'; -- this fails with error "Unknown column 'Field.1' in 'field list'
3) Table.FieldbyName('Field1.').AsString := 'Test'; -- this fails with error "#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 ')
VALUES
('Test1')' at line 2.
---------------------------
OK
---------------------------"
Before upgrading to Delphi 2009 I used Delphi 2006, and here all worked ok.
Do you have a solution for this big problem?
To reproduce:
CREATE TABLE `test` (
`ID` int(11) NOT NULL auto_increment,
`Field1` varchar(20) default NULL,
`Field.1` varchar(20) default NULL,
`Field1.` varchar(20) default NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
If posting to
1) Table.FieldbyName('Field1').AsString := 'Test'; -- this is ok
2) Table.FieldbyName('Field.1').AsString := 'Test'; -- this fails with error "Unknown column 'Field.1' in 'field list'
3) Table.FieldbyName('Field1.').AsString := 'Test'; -- this fails with error "#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 ')
VALUES
('Test1')' at line 2.
---------------------------
OK
---------------------------"
Before upgrading to Delphi 2009 I used Delphi 2006, and here all worked ok.
Do you have a solution for this big problem?