469,623 Members | 1,850 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Use ADO shape command with DB2?

Hello,
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
from:

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

to:

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 1639

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 devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.