Hi,
I want to get parameter with variant type from UniSQL.. When I set
for i := 0 to UniSql.Params.Count-1 do begin
UniSql.Params.ParamType := ptInputOutput;
UniSql.Params.DataType := ftVariant;
end;
UniSql.Execute;
This Code cause "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Parameter[0] :KEYPARAM - invalid ParamType (Status = 1h)."
With ADODB.AdoCommand component, I can use ftVariant Params for get values...
Do you support this usage style?
Thanks.
I can not get param value when Param.DataType = ftVariant
-
- Posts: 32
- Joined: Mon 25 Aug 2008 18:28
-
- Posts: 32
- Joined: Mon 25 Aug 2008 18:28
UniSql and AdoCommand do not produce same result
Hi,
I wrote a comparing code as follow:
procedure TForm1.Button2Click(Sender: TObject);
var V : Variant; S : String;
begin
//UNIDAC : Taking date type field value as variant parameter
UniSQL1.SQL.Text := 'SELECT :PR = ADATEFIELDNAME FROM ATABLE WHERE ATABLEID=123';
UniSQL1.Params[0].ParamType := ptInputOutput;
UniSQL1.Params[0].DataType := ftVariant;
UniSQL1.Execute;
V := UniSQL1.Params[0].Value;
S := VarToStr(V);
Memo1.Lines.Add('UniSql > Value: '+ S + ' :'+ VarTypeAsText(VarType(V)));
//ADO : Same code for ADO
ADOCommand1.CommandText := 'SELECT :PR = ADATEFIELDNAME FROM ATABLE WHERE ATABLEID=123';
ADOCommand1.Parameters[0].Direction := pdInputOutput;
ADOCommand1.Parameters[0].DataType := ftVariant;
ADOCommand1.Execute;
V := ADOCommand1.Parameters[0].Value;
S := VarToStr(V);
Memo1.Lines.Add('AdoCmd > Value: '+ S + ' :'+ VarTypeAsText(VarType(V)));
end;
And results are not same..
UniSql > Value: Aug 1 2008 10:07PM :OleStr
AdoCmd > Value: 01.08.2008 22:07:49 :Date
As I understand, ftVariant type parameter is not supported properly in UNIDAC... ADOCommand detect fieldtype correctly and get parameter value as Date type, and put into variant variable..
This is very sad.. Because this flexibility is very important for my project.
I adapt lots of code, and now I stop and wait for the solution...
I am waiting for Devart team support...
I wrote a comparing code as follow:
procedure TForm1.Button2Click(Sender: TObject);
var V : Variant; S : String;
begin
//UNIDAC : Taking date type field value as variant parameter
UniSQL1.SQL.Text := 'SELECT :PR = ADATEFIELDNAME FROM ATABLE WHERE ATABLEID=123';
UniSQL1.Params[0].ParamType := ptInputOutput;
UniSQL1.Params[0].DataType := ftVariant;
UniSQL1.Execute;
V := UniSQL1.Params[0].Value;
S := VarToStr(V);
Memo1.Lines.Add('UniSql > Value: '+ S + ' :'+ VarTypeAsText(VarType(V)));
//ADO : Same code for ADO
ADOCommand1.CommandText := 'SELECT :PR = ADATEFIELDNAME FROM ATABLE WHERE ATABLEID=123';
ADOCommand1.Parameters[0].Direction := pdInputOutput;
ADOCommand1.Parameters[0].DataType := ftVariant;
ADOCommand1.Execute;
V := ADOCommand1.Parameters[0].Value;
S := VarToStr(V);
Memo1.Lines.Add('AdoCmd > Value: '+ S + ' :'+ VarTypeAsText(VarType(V)));
end;
And results are not same..
UniSql > Value: Aug 1 2008 10:07PM :OleStr
AdoCmd > Value: 01.08.2008 22:07:49 :Date
As I understand, ftVariant type parameter is not supported properly in UNIDAC... ADOCommand detect fieldtype correctly and get parameter value as Date type, and put into variant variable..
This is very sad.. Because this flexibility is very important for my project.
I adapt lots of code, and now I stop and wait for the solution...
I am waiting for Devart team support...
-
- Posts: 32
- Joined: Mon 25 Aug 2008 18:28
Is Devart Support Team working?
I sent this problem to Devart Support.. But after 2 days no response!