ADO Type Library and Parameters to CoCommand

Hiya, using D4 and ADO2.6, I'm trying to run a stored procedure with
parameters but keeping getting errors returned to say my parameters
havn't been set properly or something.

I've seen old posts to this news group asking a similiar thing, but
couldn't find any followups :(

The code I'm using is:

var
  Cmd: _Command;
  Rs: _RecordSet;
  ra: OleVariant;
begin
  Cmd := CoCommand.Create;
  Cmd.Set_ActiveConnection(Conn);
  Cmd.CommandText := 'tp_next_tdcontrol';
  Cmd.Parameters.Append(Cmd.CreateParameter('@entity', adVarChar,
    adParamInput, 40, 'Worktrans'));
  Cmd.Parameters.Append(Cmd.CreateParameter('@next_ref', adInteger,
    adParamOutput, -1, 0));
  Cmd.Execute(ra, EmptyParam, adExecuteNoRecords);
  Result := Cmd.Parameters.Item['@next_ref'].Value;
end;

and the error I get is "Procedure 'tp_next_tdcontrol' expects parameter
'@entity', which was not supplied".  Is there something I'm missing?

Mark