Home > Archive > MS SQL Server ODBC > October 2006 > ODBC - SQL Server 200 - MFC - Visual C++.NET (2003)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ODBC - SQL Server 200 - MFC - Visual C++.NET (2003)
Florin

2006-10-24, 6:40 pm

Hello!

My problem is:

In Sql Server I made a table "Nir" with 3 columns:

Nr_crt - numeric

Val_TVA - numeric

Val_Tot - numeric



In SQL Server the command:

SELECT SUM(Val_TVA) AS Val_TVA, SUM(Val_Tot) AS Val_Tot FROM Nir - returned
me a result with 2 sums... OK!



My question is:

In Visual C++ - MFC I don't know how can to execute this command and to get
the result return by this comand (may be with a VARIANT - pvRecord I don't
know)

How to access the result return by this command??????????

I use CDatabase and CRecordset.



Thank You very much!



Mike C#

2006-10-24, 6:40 pm

Create a CRecordset, then execute the SQL statement on it. Then you have
can use GetFieldValue on the recordset grab the results in CDBVariants.

"Florin" <Florin@discussions.microsoft.com> wrote in message
news:382C3711-E222-4173-BF8A- 81EBD7E3508A@microso
ft.com...
> Hello!
>
> My problem is:
>
> In Sql Server I made a table "Nir" with 3 columns:
>
> Nr_crt - numeric
>
> Val_TVA - numeric
>
> Val_Tot - numeric
>
>
>
> In SQL Server the command:
>
> SELECT SUM(Val_TVA) AS Val_TVA, SUM(Val_Tot) AS Val_Tot FROM Nir -
> returned
> me a result with 2 sums... OK!
>
>
>
> My question is:
>
> In Visual C++ - MFC I don't know how can to execute this command and to
> get
> the result return by this comand (may be with a VARIANT - pvRecord I don't
> know)
>
> How to access the result return by this command??????????
>
> I use CDatabase and CRecordset.
>
>
>
> Thank You very much!
>
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com