how to use adox to get primary key? Exception occurs!
- From: eagleinfly@xxxxxxxxx
- Date: 5 May 2006 08:13:00 -0700
Exception occurs when I try to get primary key using adox. The first
place is: table->Keys->Count, and the second place is print exception
when I try to catch the exception.
Anyone can help? Thanks very much.
try{
HRESULT hr = S_OK;
ADOX::_CatalogPtr catalog;
hr = catalog.CreateInstance(__uuidof (ADOX::Catalog));
catalog->PutActiveConnection(_variant_t((IDispatch *) m_connPtr));
ADOX::_TablePtr table = catalog->Tables->GetItem("user");
ADOX::_KeyPtr index;//key;
int c = table->Keys->Count; //Exception occurs here
}catch(_com_error e){
try{
cout << "Error at GetPrimaryKey, Description:" <<
(char*)e.Description() << ", Error message: " <<
(char*)e.ErrorMessage(); //Exception occurs again!!!
}catch(...){
}
}
.
- Follow-Ups:
- Re: how to use adox to get primary key? Exception occurs!
- From: eagleinfly
- Re: how to use adox to get primary key? Exception occurs!
- Prev by Date: Re: Same DB, same SP, differente results !
- Next by Date: connection issue
- Previous by thread: Re: Same DB, same SP, differente results !
- Next by thread: Re: how to use adox to get primary key? Exception occurs!
- Index(es):
Relevant Pages
|
|