🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: SQL Functions through ADO

#1631
From: Viatcheslav V. Vassiliev
Date: Fri, 11 Jun 2004 09:59
57 lines
2715 bytes
Return data into ADODataSet and get result as

ADODataSet1->Fields[0]->Value (or AsInteger).

Do not connect this ADODataSet to DBGrid.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Heinz Ketchup" <heinz_like_the_ketchup@n0spam.h0tmail.c0m> �������/��������
� �������� ���������: news:40c90d84$1@newsgroups.borland.com...
> Thanks everyone for your help!
> I have definitely learned quite a bit.
>
> Is it possible to make use of SQL Functions?
> Min / Max / Sum / Count / Average?
>
> Whenever you make a call (ExecSQL / Open)
> It returns Data usually to a DBGrid / Table
> What if we just want to message box the results?
> or
> Store it in a variable for something else?
>
> Should I even consider trying to use a TDecisionCube?
> It appears to make use of some of the SQL Functions
> I need.
> Min / Max / Sum / Count / Average.
>
> <example of some of the things I've tried / didn't work>
> SELECT COUNT(*)
> FROM TableName
> INTO :COUNTERVARIABLE
>
> SomeVariant = ....->ParamByName("COUNTERVARIABLE")->Value;
>
> Anything to assign a value to a variable would be really nice.
> I can always do it the hardway, which is to code in functions, but that
> defeats the purpose of SQL Functions.
>
> PS: The only one that currently works in respect to COUNT is ->RecordCount
> (But that is only after a Dataset has been opened on a query)
>
> Hopefully, these are all the questions I'll need to ask.
> ***Hopefully***
>
>
> Thanks for the help everyone.
> It really has been great.
>
> Heinz
>
>
Technical Details
Message-ID: <40c98277$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40c90d84$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,169627c1f4340994
X-Google-Attributes: gid10698b,public
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <40c90d84$1@newsgroups.borland.com>
Subject: Re: SQL Functions through ADO
Date: Fri, 11 Jun 2004 13:59:20 +0400
Lines: 59
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: 213.234.218.42
Message-ID: <40c98277$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1086947959 213.234.218.42 (11 Jun 2004 02:59:19 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail