OpenSchema

I am building a small tool that will be used to compare 2 database to find differences. I want this
tool to work at least with SQL and Access databases.

For that topic I use a mixture of ADO and ADOX (to have the most detail possible).

My problem for now is that I can retreive the Description field for Access tables and columns but not
for SQL.

This is my code to get the description:
   ' ----- Retrieve the description from standard ADO since ADOX doesn't
   '       have it recorded.
   Set rsInfo = connSchema.OpenSchema(adSchemaTables, _
       Array(Empty, Empty, sTableName, "TABLE"))
   If Not (rsInfo.EOF) Then GetTableDesc = rsInfo!Description & ""


How can I retreive that?


Note that this is a cross-post from the VB-Databases topic (http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=vbdatabases&qid=20161951) because I didn't had good answers!
LVL 71
Éric MoreauSenior .Net ConsultantAsked:
Who is Participating?
 
AccessHelpNetConnect With a Mentor Commented:
The description field in adSchemaTables is defined in the OLEDB specs as "optional" and I don't think any ADO provider for SQL server has ever populated it.

regards,

Dave Kawliche
http://AccessHelp.net
http://1ClickDB.com
0
 
nigelrivettCommented:
Which versions of sql server are you targetting.
As AngelIII say's it's not available v7 and before.
0
 
Éric MoreauSenior .Net ConsultantAuthor Commented:
SQL 2000.
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
Éric MoreauSenior .Net ConsultantAuthor Commented:
I have created descriptions (in SQL 2000) for test purposes and I don't see them in my results. The same code is working for an Access DB.
0
 
acampomaCommented:
execute sp_columns tablename
execute sp_Keys tablename
0
 
Éric MoreauSenior .Net ConsultantAuthor Commented:
"execute sp_columns tablename"

Gives a bunch of details about columns but not the description.

"execute sp_Keys tablename"

This SP doesn't seems to exist?

I would really prefer (if possible) a ADO solution because I want the application to be portable.
0
 
Éric MoreauSenior .Net ConsultantAuthor Commented:
I have found my descriptions into the sysProperties table but again I would really prefer (if possible) a ADO solution because I want the application to be portable.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
which version of ADO are you using, I guess ADO 2.6...
0
 
Éric MoreauSenior .Net ConsultantAuthor Commented:
Right. 2.6
0
 
Éric MoreauSenior .Net ConsultantAuthor Commented:
Any objections in sending this question to PAQ?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
No objections...
Sad enough, but there seems to be no generic answer here...
0
 
Éric MoreauSenior .Net ConsultantAuthor Commented:
Seems that it does not exists.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.