Solved

How to get MS Database Schema!

Posted on 2006-06-11
1
260 Views
Last Modified: 2010-04-23
Hi, What i am trying to achieve is to be able to get a microsoft database schema based only on database and its location. The purpose of this application is to be able to allow the user to spesify a database as shown underneath and based on this information to be able to get a list of available tables that are in the database. unfortunately i get run time errors.
my code is as follows:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

   
        Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\vb.mdb"
        Dim myConnection As OleDbConnection = New OleDbConnection()

        myConnection.ConnectionString = connString

        ' create a data adapter
        ' ' Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select * from person", myConnection)

 1*       TextBox1.Text = myConnection.GetSchema().ToString
 End Sub
 Whenever i run the application i get the following error: "Invalid operation. The connection is closed at position 1*."

Does anyone know how to get a schema, the solution doesn't have to be based on the above code , Thanks in advance!
0
Comment
Question by:mmouzakitis
1 Comment
 
LVL 14

Accepted Solution

by:
ptakja earned 500 total points
ID: 16882690
The error stated that the connection is closed. Did you try opening the connection first?

Myconnection.Open
TextBox1.Text = myConnection.GetSchema().ToString
MyConnection.Close

0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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