Solved

OpenSchema in VB .NET

Posted on 2006-11-21
5
685 Views
Last Modified: 2008-03-03
Does anyone have some sample VB .NET code that shows how to use OpenSchema?


My intent is to ask a database what tables are inside of it.

Then to take that list of tables and ask each table what the column names are that it has.
0
Comment
Question by:knowlton
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:Hillwaaa
ID: 17990848
Hi knowlton,

Are you using this for an Analysis Services cube?  If not I'm not sure if OpenSchema is what you want.

If you just want a list of all tables in the (assuming SQL Server 2000) database, use:

select name, id from sysobjects where xtype = 'U'  

then to get all of the column names, use:

select name from syscolumns where id = <id from previous query>


Cheers,
Hillwaaa
0
 
LVL 5

Author Comment

by:knowlton
ID: 17990857
What about if it is an MS Acess MDB file?
0
 
LVL 16

Accepted Solution

by:
Hillwaaa earned 500 total points
ID: 17990906
knowlton,

Then I'd suggest looking at the code here: http://www.freevbcode.com/ShowCode.asp?ID=3884

It's VB6 but should be fairly easy to translate to VB .NET, and contains an example on using OpenSchema :)
0
 
LVL 5

Author Comment

by:knowlton
ID: 17992109
Thank you.
0
 
LVL 16

Expert Comment

by:Hillwaaa
ID: 17992113
No worries!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now