i am new with uniDAC since yesterday

Now i have a problem with scope identity.
I have a Test-Application with a Insert INTO -Statement with one parameter... It will work perfect:
Code: Select all
UniQuery1.Active := false;
UniQuery1.SQL.Clear;
UniQuery1.SQL.Add('INSERT INTO test (name) VALUES (:name)');
UniQuery1.Params.ParamByName('name').Value := Edit1.Text;
UniQuery1.SQL.Add('SET :id = SCOPE_IDENTITY()');
UniQuery1.Params.ParamByName('id').DataType := ftInteger;
UniQuery1.Params.ParamByName('id').ParamType := ptInputOutput;
UniQuery1.Execute;
Label1.Caption := UniQuery1.ParamByName('id').AsString;
Code: Select all
UniQuery1.SQL.Add('SET :id = SCOPE_IDENTITY()');
UniQuery1.Params.ParamByName('id').DataType := ftInteger;
UniQuery1.Params.ParamByName('id').ParamType := ptInputOutput;
Parameter[51]:id - invalid ParamType (Status = 1h).
I use MS SQL 2005. What will here going wrong?
I tried the code from the Testapplication with the same Database from the other application. No error... i really don`t understand it...

After searching in the forum, i tried to put the line:
Code: Select all
UniQuery1.Params.ParamByName('id').ParamType := ptInputOutput;
What can i do to find the failure?
Thanks a lot for your help...
Andy