Re: OLE error 80040E21 reading BIGINT using AsFloat



John Herbster wrote:


Dan, I hope that I fixed the above correctly.

?


I am not familiar with ADO, but I assume that BIGINT is 64-bits
signed integer, and that ADO does not allow reading as such.

I have not used MS SQL Server so I can't really tell what BIGINT is but
I would like to think that ADO *can* handle it, since it is the native
component set for that RDBMS...



As far as a work-a-round, can you bypass the AsInteger
and AsFloat and read the 64-bits out of the record buffer
as bytes? If so, then you could convert the 8-bytes directly
into 8-byte buffer and from there directly into an Int64
integer type.


this remembered me something and after digging a bit I think Dan could
try to use following:

function GetBytesAsMB: Real;
var
number : Int64;
begin
Number :=
TLargeIntField(adodataset1.Fields.FieldByName('field')).AsLargeInt;
Result := Number / 1048576;
end;

--
Best regards :)

Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
--
Contribute to the Indy Docs project: http://docs.indyproject.org
--
In order to contact me remove the -nospam

.



Relevant Pages

  • RE: Using ADO to get the first 5 fields horizontaly
    ... "Dan" wrote: ... I know how to retieve data via ADO from access. ... retrieve only the first 5 first records of the result of SQL ...
    (microsoft.public.excel.programming)
  • Re: whats wrong with this?
    ... verified it with MSDN & many other websites ... it is still available in ADO 2.8, looks like MS might have dropped it. ... Dan ...
    (microsoft.public.data.ado)