Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another
Hello
There is MySQL database with table:
CREATE TABLE `objects` (
`uniq_id` int(11) NOT NULL,
`dt` datetime NOT NULL,
`valid` tinyint(1) NOT NULL,
`id` int(11) NOT NULL,
`ip` varchar(50) NOT NULL,
PRIMARY KEY (`uniq_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
I'm using ADO components and MySQL ODBC Connector to access database and have a problem when debug application.
Error occure when I assign sql query with parameter. You can see it below.
Error message: "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another"
ADOConnection1.ConnectionString := 'Provider=MSDASQL.1;Password=root;Persist Security Info=True;User ID=root;Data Source=MyDataSource;Initial Catalog=test_db';
GetLocksQuery.Close();
GetLocksQuery.SQL.Text :=
'select o.* from objects o '+
'INNER JOIN '+
'(SELECT id, MAX(DT) AS MAX_DT FROM objects GROUP BY id) oo '+
'ON (oo.id = o.id) AND (oo.MAX_DT = o.DT) '+
'WHERE valid = 1 and o.ip = :object_ip '; // HERE ERROR!
GetLocksQuery.Parameters.ParamByName('object_ip').Value := '127.0.0.1';
GetLocksQuery.Open();
if not GetLocksQuery.Eof then
begin
Caption := GetLocksQuery.FieldByName('id').AsString;
end;
GetLocksQuery.Close();
Error appears in Delphi/Builder of all edition (6,7,RAD)
When starting program without debuger - all is OK!
I try reinstall ODBC connector - without changes
Subject
Written By
Posted
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another
May 25, 2018 12:55AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.