Strange error
Posted: 15.05.2018, 21:04
Hi All
I have a situation i don't understand. I hope someone can throw some light on.
The code below query's an OLEDB provider for a small, little known business database. After initiating the query from inside a mormot SOA server, there is about a 10 second delay. The server log throws an error, "current provider does not support commands with parameters". It then produces the correct result. I have tried the same code with a vcl component outside of mormot server. The delay is about the same but the the result comes with no error shown.
ta: TZConnection;
qu: TZReadOnlyQuery;
begin
try
ta := TZConnection.Create(nil);
ta.ReadOnly := true;
ta.Version := '7.2.1-rc';
ta.UseMetadata := false;
ta.Protocol := 'ado';
ta.Database := 'Provider=PBSOLEDB.PBSOLEDB;User ID=pricefind;Data Source=G:\Prophet;Location=G:\Prophet\datahl';
ta.Connected := true;
qu := TZReadOnlyQuery.Create(nil);
qu.AutoCalcFields := true;
qu.Connection := ta;
qu.SQL.Clear;
qu.Active := false;
qu.SQL.text := 'Select AverageCost, SellingPrice1, SellingPrice2, SellingPrice6, Description from ICBase where Code = ''' + partNo + '''';
qu.Open;
result := qu.FieldByName('AverageCost').AsFloat;
I have a situation i don't understand. I hope someone can throw some light on.
The code below query's an OLEDB provider for a small, little known business database. After initiating the query from inside a mormot SOA server, there is about a 10 second delay. The server log throws an error, "current provider does not support commands with parameters". It then produces the correct result. I have tried the same code with a vcl component outside of mormot server. The delay is about the same but the the result comes with no error shown.
ta: TZConnection;
qu: TZReadOnlyQuery;
begin
try
ta := TZConnection.Create(nil);
ta.ReadOnly := true;
ta.Version := '7.2.1-rc';
ta.UseMetadata := false;
ta.Protocol := 'ado';
ta.Database := 'Provider=PBSOLEDB.PBSOLEDB;User ID=pricefind;Data Source=G:\Prophet;Location=G:\Prophet\datahl';
ta.Connected := true;
qu := TZReadOnlyQuery.Create(nil);
qu.AutoCalcFields := true;
qu.Connection := ta;
qu.SQL.Clear;
qu.Active := false;
qu.SQL.text := 'Select AverageCost, SellingPrice1, SellingPrice2, SellingPrice6, Description from ICBase where Code = ''' + partNo + '''';
qu.Open;
result := qu.FieldByName('AverageCost').AsFloat;