OLE error 80040E21 reading BIGINT using AsFloat



Hello,

We have a program that connects to a SQL Server database. There are
several BIGINT fields in the database. To retrieve data from one of the
fields, we use the following code:

function GetBytesAsMB: Real;
begin
Result:=DMMSSQL.QryServers.FieldByName('BytesPerLimit').AsFloat/1048576;
6; end;

Now, for 90% of our customers, this works just fine. We can't retrieve
using "AsInteger" because the number can easily be larger than the number
supported by the Integer type. However, a few installations return the
following error:

exception class : EOleException
exception message : OLE error 80040E21.

The exception is raised at line 4199 in ADODB.pas:

DataConvert(Field, @C, Buffer, True) else

First question: Is there a SQL Server setting that could be preventing
this from working?

Second question: Is there a safer way to do this?

Thanks,
Dan


.



Relevant Pages

  • Re: SQL server question
    ... Microsoft is deprecating it even for new development, ... An Access project is an Access file that provides a direct, ... You can connect an Access project to a remote SQL Server ... a local SQL Server database, or a local installation of the SQL Server ...
    (comp.databases.ms-access)
  • Exactly How to Use Disconnected Recordsets in VB / SQL Server Application
    ... Front-end is VB 6.0, back-end is SQL Server 2000 (actually, MSDE since ... underlying SQL Server database w/the assumption that the user *might* ... the local disconnected recordset on the user's machine would seem to ... time to update each and every record as each user scrolls through the ...
    (microsoft.public.vb.database)
  • Re: DataSet.GetChanges() in RowChanged(DataRowAction.Add)
    ... if the way synchronization needs to be handled changes in the ... > data stored in an SQL Server database. ... > GetChanges() call, but I feel that this workaround is not my best choice. ...
    (microsoft.public.dotnet.framework.adonet)
  • VBA Microsoft Access and SQL Server
    ... I am currently working on a project with Power Point. ... into a Microsoft SQL Server database. ... information from the Microsoft SQL Server database and re-populate a Power ...
    (microsoft.public.office.developer.vba)
  • Re: curious problem in production
    ... thank for the lesson on unique keys, but I suggest you read the question ... I am getting an exception from sql server ... >> trying to insert into the same sql server database. ...
    (microsoft.public.sqlserver.server)