Variant does not reference an automation object

I use ADO to connect Oracle8i DB. I have two master_detail tables.
One is named Pgm with Fields: PgmSeq(Number), PgmName(Varchar2(10))
and PgmSeq if primary key.
The other is PgmItem with Fields: PgmSeq(Number), Seq(Number),
Msg(Varchar2(30))
and PgmSeq & Seq are primary keys.
I use PgeSeq as MasterField. When PgmItem insert a new record,
I use the PgmItem.RecordCount+1 as the value of the field Seq.
So when PgmItem delete one record, I use a TQuery(ADOQuery1)
to update the value of field Seq.
the SQL.Text is: Update PgmItem Set Seq = Seq - 1 Where PgmSeq = :PgmSeq
 And Seq = :Seq.
It popups an error message where the app run to the line below:
?@
?@ADOQuery1.Parameters.ParamValues['PgmSeq'] :=
?@?@tblPgm.FieldByName('PgmSeq').AsInteger
?@
The error message is: Variant does not reference an automation object.
How do I do to avoid this message? Thanks all.

hagar.