> > > 2) Implement results as a returned object from pg_database
> > > result = db.exec();
> > > result >> field1 >> field2 >> field3;
> > > and
> > > field = result["field"];
> > > field = result[fieldnum];
Rogue Wave Software has an SQL C++ interface in dbtools.h++. It is
similar to what you describe. Here is a sample program:
#include <rw/db/db.h>
int main ()
{
1. RWDBDatabase enterpriseDB = RWDBManager :: database
("SYBASE", "SYBASESERVER", "ME", "PASSWORD", "DATA");
RWDBTable table1 = enterpriseDB.table("Actual_Sales");
2. RWDBReader table1Reader = table1.reader();
RWDBDatabase spreadsheet = RWDBManager :: database
("ODBC", "MS_EXCEL", "ME", "PASSWORD", "C:\mydir");
3. spreadsheet.createTable ("TMPSALES", table1.schema());
RWDBTable spreadsheetTable = spreadsheet.table ("TMPSALES");
4. RWDBInserter localInserter = spreadsheetTable.inserter();
while (table1Reader()) {
localInserter << table1Reader;
localInserter.execute();
}
...
5. /* Insert DDE code to plot your sales forecast, stored
in the second spreadsheet, versus actual sales now
stored in the TMPSALES spreadsheet. */
}
There are white-papers describing the interface. It may be helpful for
ideas. You can see more at:
http://www.roguewave.com/products/xplatform/dbtools/
--
Bruce Momjian | http://candle.pha.pa.us
[EMAIL PROTECTED] | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026