473,378 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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;
try{
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){
//something
}catch(...){
//something
}

May 11 '06 #1
0 1287

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Joe User | last post by:
QUESTION for the experts out there :) Is it possible to write a query that would list the datafields by each table in a database? How would I do that?!?! TIA Joe
1
by: Gary Warner | last post by:
Using Visual Basic with an ADO connection to MS-Access, I'd like to be able to pull the names of all tables, the column names in those tables, and the field TYPE and COMMENT. I've got the code...
4
by: Irena | last post by:
Hi all there, I have developed an ASP script that is able to read the structure of an Ms Access database ( via object objConn.OpenSchema(27) ) and to identify the foreign Keys columns and tables...
19
by: davegb | last post by:
Have been trying, in my spare time, to create an Access db for the employees in my group for over a month. It surprised me when I read in the Access Bible that a relationship between the Primary...
0
by: Denis ERCHOFF | last post by:
Hi, The OpenSchema method (ADODB._Connection object) seems to work fine in VB but not with C# .... Why? Someone have a solution? My code :
4
by: abcd | last post by:
I have a small VB code which retrives the table names from the access DSN. my code is something like this Set objRs = objConn.OpenSchema(adSchemaTables) If objRs("TABLE_TYPE") = "TABLE" or...
4
by: Paul H | last post by:
OK, I tried getting and old Newbury Data ND2500 working using the "Generic /Text only" driver in Win XP. It prints, but I could not find a way to set a custom page size that matches the paper I am...
0
by: Farmer | last post by:
Hi Folks, I have been trying for a whole day yesterday to find out how to do this and found nothing here (maybe I didn't look well enough I dont know). But here it is I found some code on msdn...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.