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



"Ashish P K" <AshishP@xxxxxxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:42dfb320@xxxxxxxxxxxxxxxxxxxxxxxxx
> 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
>
>
It would be much easier if you will switch to TADODataSet, than just
populate FieldDefs collection and invoke CreateDataSet.

Regards,
Vitali


.



Relevant Pages

  • Arguments are of the wrong type, are out of acceptable range or are in conflict with one another
    ... add a field in a recordset object. ... Result.Fields.Append('AP_ACNT', adVarChar, 40, adFldMayBeNull, ... EmptyParam); // this line fails ... This code works for the first time, when this method is called for the ...
    (borland.public.delphi.database.ado)
  • Re: Recordset or Object is closed HELP PLEASE!
    ... this is the first time i'm doing VBA. ... how am i supposed to display the records found in the recordset onto the excel sheet? ... >> different query that is simpler. ... >> that this query Declares Variables and Sets those ...
    (microsoft.public.excel.programming)
  • Re: Newbie question on Datatable
    ... Best regards, and once again, thank you for your time ... new Access recordset that is derived from an Access Query. ... As a VB6 coder you probably own or know of "Programming Microsoft ... Dataset is a container around multiple datatables and / or data adapters ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Please Help!? new User
    ... OK thanx Klatuu I'll save that for tommorrow! ... Regards ... It has to do with how the recordset is defined. ... >> Ashley Smart ...
    (microsoft.public.access.formscoding)
  • Re: ADO Recordset second Update fails
    ... > Hi Folks, first time in MSDN.... ... > the description of the context is that I am using an autonumber column to ... > using SQLServer provider but when I use MS-Access provider it works just ... been inserted using this recordset, ...
    (microsoft.public.data.ado)