Need example of using SHAPED query with ADO and vc++ 
Author Message
 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



Tue, 13 Aug 2002 03:00:00 GMT  
 Need example of using SHAPED query with ADO and vc++
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



Fri, 16 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

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

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

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

4. Need example of owner-drawn combo box using VC 4.2

5. Need information about using ADO in VC++5.0

6. ADO: VC++ Extensions with the SHAPE Command

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

8. inserting a value for the datetime field using ado in vc++

9. Example of how to open a connection, collect and report on a reco rdset using ADO

10. Using queries with params in VC

11. VC++ examples w/ ADO?

12. VC++ examples w/ ADO?

 

 
Powered by phpBB® Forum Software