Arguments are of the wrong type, are out of acceptable range or are in conflict with one another



Hi ,
I am getting this error "Arguments are of the wrong type, are out of
acceptable range or are in conflict with one another" while trying to
add a field in a recordset object. I am using ADO 2.6

The code snippet is as given below.

function MyMethod :_Recorset // This is com+ method
begin
Result := CoRecordset.Create;
Result.Fields.Append('AP_ACNT', adVarChar, 40, adFldMayBeNull,
EmptyParam); // this line fails
Result.Fields.Append('AR_ACNT', adVarChar, 40, adFldMayBeNull,
EmptyParam);

Result.CursorLocation := adUseClient;
Result.Open(EmptyParam, EmptyParam, adopenStatic, adLockBatchOptimistic,
adCmdUnknown);
Result.AddNew(EmptyParam, EmptyParam);
Result.Fields['AP_ACNT'].Value := 'ABC';
end;

I am using this recordset as a temporary (Disconnected) recordset and
passing it back to the client after population some values.
This code works for the first time, when this method is called for the
second time it throws the error, when trying to append

Can some one help me to sort out this error.


Regards,
Ashish


.



Relevant Pages