Need example of using SHAPED query with ADO and vc++

Need example of using SHAPED query with ADO and vc++

Post by Steve Roger » Sat, 26 Feb 2000 04:00:00



I want to retrieve hierarchacle recordsets from MS SQL 7.0 using ADO from
within a visual C++ application.  I find some examples on MS site using VB,
but would like something already coded in VC++ to look at as an example.
Any out there?

TIA
Steve Rogers

 
 
 

Need example of using SHAPED query with ADO and vc++

Post by Uwe Lest » Tue, 29 Feb 2000 04:00:00


Steve Rogers schrieb:

Quote:> I want to retrieve hierarchacle recordsets from MS SQL 7.0 using ADO from
> within a visual C++ application.  I find some examples on MS site using VB,
> but would like something already coded in VC++ to look at as an example.
> Any out there?

Sorry I haven't in VC++, but IMO it is easy to translate.

fetch_all_possible_values:-
    new(Con, adoConnection),
    send(Con, provider, 'MSDataShape'),
    send(Con, open, 'ConnectionString = Data Provider=SQLOLEDB;Database=SQL_Marquard&schulz;Data Source=Lesta2;User Id=sa;Password=;'),
    new(Rs, adoRecordset),
    SQL1 = 'SHAPE {SELECT distinct produktgruppen.ID, produktgruppen.pgname FROM produktgruppen } ',
    SQL2 = 'APPEND ({SELECT DISTINCT pgfelder.pgID, pgfelder.ID, pgfelder.pgfeld, pgfelder.beschreibung, sort ',
    SQL22= 'FROM pgfelder INNER JOIN artdata ON pgfelder.ID = artdata.pgfeldID ORDER BY sort} RELATE ID TO pgID)',
    concat_atom([SQL1, SQL2, SQL22], SQL),
    send(Rs, stayInSync, false),
    send(Rs, open, SQL, Con),
    get(Rs, find_all_values, L),
    store_prodgr(L),
    free(Rs),
    free(Con).

for further information search the MSDN for the article
        "HOWTO: Use the ADO SHAPE Command"

hope this helps

--

Regards

Uwe


 
 
 

1. Need example of using SHAPED query with ADO and vc++

I want to retrieve hierarchacle recordsets from MS SQL 7.0 using ADO from
within a visual C++ application.  I find some examples on MS site using VB,
but would like something already coded in VC++ to look at as an example.
Any out there?

TIA
Steve Rogers

2. Retrieving XML from the database

3. Using ADO with vc++ 5.0 and need Interface documentation

4. Alpha CPU & NT4

5. sql advice

6. Need VC++6 Example to Update, Delete, Add and Search on Access Data

7. How do you move to the next record

8. call stored procedure using ADO in vc++?

9. Storing date/time value on SQL server with milliseconds resolution using vc++ and ado 2.0