🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1996

Re: reading large integer???

#1996
From: Arnie Mauer
Date: Mon, 08 Dec 2003 17:54
48 lines
2058 bytes
"�̿��" <ydlee@medique.co.kr> wrote in message
news:3fd3ee0b@newsgroups.borland.com...
> I created a table in mssql using
>
>    CREATE TABLE sample (value BIGINT)
>
> And I inserted a value using
>
>    INSERT INTO sample VALUES (-12345)
>
> Now if I tried to read the value usind TADOQuery as follows, I get 12345,
> not -12345.
>
>   __int64 value;
>
>    query = "SELECT * FROM sample";
>
>    tADOQuery->SQL->Clear();
>    tADOQuery->SQL->Text = query.Trim();
>
>    try
>    {
>       tADOQuery->Open();
>    }
>    catch (Exception &e)
>    {
>       return;
>    }
>
>    if (tADOQuery->RecordCount > 0)
>       value = dynamic_cast<TLargeintField
> *>(tDataSource->DataSet->Fields->FindField("value"))->AsLargeInt;
>
> Can anybody tell me what I am doing wrong? Thanks in advance.
>
> --
>
> Yongduk Lee
> ydlee@medique.co.kr
>
>

This looks like a bug to me.  I can duplicate the problem.  When I use a
genreal purpose DB tool and read the column via ODBC, I get the
expected -12345.

-- Arnie
Technical Details
Message-ID: <3fd4ba97$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news.octanews.net!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fd3ee0b@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,bc39068203b66421
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-12-08 10:09:55 PST
From: "Arnie Mauer" <xxx@nowhere.net>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3fd3ee0b@newsgroups.borland.com>
Subject: Re: reading large integer???
Date: Mon, 8 Dec 2003 12:54:16 -0500
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 209.140.211.97
Message-ID: <3fd4ba97$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1070906007 209.140.211.97 (8 Dec 2003 09:53:27 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news.octanews.net!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail