I have run into a similar problem with Delphi 6 and have found a work around. (Keep in
mind, this wasn't a problem in MyODBC 2.50 but is with MyODBC 3.51.06).
The problem looks like it occurs when I use a TQuery component with Parameters. My SQL
looks like this:
UPDATE TaskHistory SET Status = 1,
StartTime = :PStartTime,
SQLLog = :PSQLLog,
EventLog = :PEventLog
WHERE
TaskHistoryID = :PTaskHistory
My original code looked like this:
procedure Tfrm_Main.Button3Click(Sender: TObject);
var TaskStartTime: TDateTime;
begin
TaskStartTime := Now;
qry_InitTask.Params[0].Value := TaskStartTime;
qry_InitTask.Params[1].Value := 'Some Text';
qry_InitTask.Params[2].Value := 'Some Text';
qry_InitTask.Params[3].Value := 47320;
qry_InitTask.ExecSQL;
end;
Parameter[0].DataType was ftDateTime.
With that setup I continually received the error "Operation not applicable."
To work around this I changed Parameter[0].DataType to ftString and changed my code to:
procedure Tfrm_Main.Button3Click(Sender: TObject);
var TaskStartTime: TDateTime;
begin
TaskStartTime := Now;
qry_InitTask.Params[0].Value := FormatDateTime('yyyy-mm-dd hh:nn:ss', TaskStartTime);
qry_InitTask.Params[1].Value := 'Some Text';
qry_InitTask.Params[2].Value := 'Some Text';
qry_InitTask.Params[3].Value := 47320;
qry_InitTask.ExecSQL;
end;
I hope that helps!
- Mike Farmer