467,189 Members | 1,264 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

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

Can't get primarykey list using ado openschema

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
  • viewed: 1194

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Joe User | last post: by
19 posts views Thread by davegb | last post: by
reply views Thread by Denis ERCHOFF | last post: by
4 posts views Thread by abcd | last post: by
4 posts views Thread by etuncer@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.