By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,334 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,334 IT Pros & Developers. It's quick & easy.

Can't get primarykey list using ado openschema

P: n/a
I'm trying to get primary key list from db2 using ado, but it doesn't
work since pRstSchema->adoEOF always return true when I connect to db2
while it works with access and sql server. I have tried using adox to
get the key, but still failed.

Anyone could help? advance thanks!

_ConnectionPtr m_connPtr;
_RecordsetPtr pRstSchema;
if (FAILED(m_connPtr.CreateInstance(__uuidof(Connecti on))) ){
return ;

if (FAILED(m_connPtr->Open(_bstr_t(host), "", "", -1))){
return ;

pRstSchema = m_connPtr->OpenSchema(adSchemaPrimaryKeys);

for(; !pRstSchema->adoEOF; pRstSchema->MoveNext())
//some code here, but never reach this place when i using db2
//but it works fine for access and sql server.
}catch(_com_error e){

May 11 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.