🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Accessing Query result ("SELECT count(*) ...")

#5679
From: Chokchai Songjareanzup
Date: Thu, 08 Mar 2001 08:15
31 lines
1607 bytes
Try this,
"SELECT count(*) AS CNT FROM pub.trade_acct"
AnsiString x = DM_MainChqType->Q_tradeacct->FieldByName("CNT")->AsString;

Chokchai

"Sandi Wijaya" <sandiwijaya@yahoo.com> wrote in message
news:3aa5a085_1@dnews...
> Hi, everyone
>
> I want to ask, about accessing the result of SQL statement in Query
object.
> SQL statement is :
> "SELECT count(*) FROM pub.trade_acct"
>
> the result should be an integer in to a one record and one field, right. I
> tried to access with :
> AnsiString x = DM_MaintChqType->Q_tradeacct->Fields->Fields[0]->AsString;
>
> but it's returning an exception error message that said "list is out of
> bound".
>
> How can I access the result ?
>
> Thank you in advance.
>
>
>
>
>
>
Technical Details
Message-ID: <3aa740b4_2@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!hermes.visi.com!news-out.visi.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!203.170.180.17
References: <3aa5a085_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,e643ec471dc993e1
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-03-08 00:26:10 PST
From: "Chokchai Songjareanzup" <csongjar@hotmail.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3aa5a085_1@dnews>
Subject: Re: Accessing Query result ("SELECT count(*) ...")
Date: Thu, 8 Mar 2001 15:15:36 +0700
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 203.170.180.17
Message-ID: <3aa740b4_2@dnews>
X-Trace: 8 Mar 2001 00:20:04 -0800, 203.170.180.17
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!hermes.visi.com!news-out.visi.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!203.170.180.17