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