471,863 Members | 981 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,863 software developers and data experts.

Use ADO shape command with DB2?

I have several reports that were written with ADO shape command (in
C++) to access Microsoft Access database. Now we have migrated all the
data from Access to DB2 UDB (version 8.1), and the shape command does
not work any more. I have changed the provider and connection string

pConn->Provider = "MSDataShape";
SAFE_CALL( pConn->Open( "DBQ=myAccessDB.mdb; DefaultDir=.;
Driver={Microsoft Access Driver (*.mdb)};", "sa", "", 0 ) );


pConn->Provider = "IBMDADB2";
SAFE_CALL( pConn->Open( "dsn=myDB", "myUserName", "myPwd",
adModeUnknown ) );

The following is a snippet of the shape command I have:

bstrQuery = "SHAPE {SELECT PicIndex, PicID, InspectionNumber FROM
MaskIdInfo WHERE PicIndex =";
bstrQuery += bstrPicIndex;
bstrQuery += "} APPEND ";
bstrQuery += " ({SELECT PicIndex, Date, Time FROM
PicLoadOccasion ";
bstrQuery += "ORDER BY LoadOccasionIndex DESC";
bstrQuery += "} RELATE PicIndex TO PicIndex) AS rsLoadOccasion, ";
bstrQuery += " ({SELECT PicIndex, DefectIndex FROM PicDefect ";
bstrQuery += "ORDER BY DefectIndex ";
bstrQuery += _bstr_t(sortOrder);
bstrQuery += "} RELATE PicIndex TO PicIndex) AS rsPicDefect, ";
bstrQuery += " ({SELECT PicIndex, Date, Time FROM PicRepairHist
bstrQuery += "ORDER BY PicRepairHistId DESC";
bstrQuery += "} RELATE PicIndex TO PicIndex) AS rsPicRepairHist";

I tried to change the provider to "MSDataShape" (as it was before the
migration to DB2), it does not work of course. How should I specify
the provider and the connection string so the shape command works with
DB2? Or does shape command work with DB2 at all?
Thanks for any help.
Nov 12 '05 #1
0 1735

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Anchorman | last post: by
3 posts views Thread by PM | last post: by
reply views Thread by nets-rac | last post: by
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.