473,386 Members | 1,864 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,386 software developers and data experts.

Selecting all tabels from an access db.

Hello,

I would like to load various access databases in my application, but I can't
figure out how to get all tabels from the database into my dataset.

The databases are all different, so I don't know the names of any tables.

Any help on how to solve this would be greatly appreciated!

--
Lasse
Nov 20 '05 #1
12 1280
Depends on your databale. Table names in access can be found using the
system table.

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "MSys*") AND ((MSysObjects.Type)=1
Or (MSysObjects.Type)=6))
ORDER BY MSysObjects.Name;

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Lasse Eskildsen" <Le******************@webspeed.dk> wrote in message
news:ez*************@TK2MSFTNGP10.phx.gbl...
Hello,

I would like to load various access databases in my application, but I can't figure out how to get all tabels from the database into my dataset.

The databases are all different, so I don't know the names of any tables.

Any help on how to solve this would be greatly appreciated!

--
Lasse

Nov 20 '05 #2
Hi,
Another method.

Dim strConn As String

Dim conn As OleDbConnection

strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"

strConn &= "Data Source = Northwind.mdb;"

conn = New OleDbConnection(strConn)

conn.Open()

Dim dtTableNames As DataTable

dttablenames = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _

New Object() {Nothing, Nothing, Nothing, "TABLE"})

conn.Close()

Dim dr As DataRow

For Each dr In dtTableNames.Rows

Trace.WriteLine(dr.Item("TABLE_NAME"))

Next

Ken

----------------------

"Lasse Eskildsen" <Le******************@webspeed.dk> wrote in message
news:ez*************@TK2MSFTNGP10.phx.gbl...
Hello,

I would like to load various access databases in my application, but I can't
figure out how to get all tabels from the database into my dataset.

The databases are all different, so I don't know the names of any tables.

Any help on how to solve this would be greatly appreciated!

--
Lasse

Nov 20 '05 #3
On Sun, 25 Jul 2004 17:49:52 +0100, "One Handed Man \( OHM - Terry Burns \)" <news.microsoft.com>
wrote:

¤ Depends on your databale. Table names in access can be found using the
¤ system table.
¤
¤ SELECT MSysObjects.Name
¤ FROM MSysObjects
¤ WHERE (((MSysObjects.Name) Not Like "MSys*") AND ((MSysObjects.Type)=1
¤ Or (MSysObjects.Type)=6))
¤ ORDER BY MSysObjects.Name;

Just an FYI, Access system tables are typically secured so they cannot be accessed. Using the schema
method is preferable.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #4
Cant say Ive ever run in to that problem yet

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:la********************************@4ax.com...
On Sun, 25 Jul 2004 17:49:52 +0100, "One Handed Man \( OHM - Terry Burns \)" <news.microsoft.com> wrote:

¤ Depends on your databale. Table names in access can be found using the
¤ system table.
¤
¤ SELECT MSysObjects.Name
¤ FROM MSysObjects
¤ WHERE (((MSysObjects.Name) Not Like "MSys*") AND ((MSysObjects.Type)=1
¤ Or (MSysObjects.Type)=6))
¤ ORDER BY MSysObjects.Name;

Just an FYI, Access system tables are typically secured so they cannot be accessed. Using the schema method is preferable.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)

Nov 20 '05 #5
On Mon, 26 Jul 2004 16:00:48 +0100, "One Handed Man \( OHM - Terry Burns \)" <news.microsoft.com>
wrote:

¤ Cant say Ive ever run in to that problem yet

You're probably using an older version of Access.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #6
No were all using 2003 professional

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:0s********************************@4ax.com...
On Mon, 26 Jul 2004 16:00:48 +0100, "One Handed Man \( OHM - Terry Burns \)" <news.microsoft.com> wrote:

¤ Cant say Ive ever run in to that problem yet

You're probably using an older version of Access.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)

Nov 20 '05 #7
Hi Terry,

I tried the method from you and from Ken,

Yours did give by me an error (even when I changed "MSys" in 'MSys')

Can you maybe check it what it can be, although the method from Ken is fine
of course, so do not take to much time for it.

However there can be a reason that you like to show it is working, by
instance for people who are later searching for this on Google

Cor
Nov 20 '05 #8
On Tue, 27 Jul 2004 07:12:30 +0100, "One Handed Man \( OHM - Terry Burns \)" <news.microsoft.com>
wrote:

¤ No were all using 2003 professional

Then the tables are probably not secured.

If you implement user-level security, access to these tables is generally removed. You will also
notice that by default the tables are not visible to the user unless this option is turned on. If
any of the system tables become corrupted your database could be hosed.

In addition, since these are internal tables used specifically by Access and Jet, there is always
the possibility that they could be changed in a future version.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #9
Thanks 4 pointing this out.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:c2********************************@4ax.com...
On Tue, 27 Jul 2004 07:12:30 +0100, "One Handed Man \( OHM - Terry Burns \)" <news.microsoft.com> wrote:

¤ No were all using 2003 professional

Then the tables are probably not secured.

If you implement user-level security, access to these tables is generally removed. You will also notice that by default the tables are not visible to the user unless this option is turned on. If any of the system tables become corrupted your database could be hosed.

In addition, since these are internal tables used specifically by Access and Jet, there is always the possibility that they could be changed in a future version.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)

Nov 20 '05 #10

"Ken Tucker [MVP]" <vb***@bellsouth.net> skrev i en meddelelse
news:ea*************@TK2MSFTNGP11.phx.gbl...
Hi,
Another method.


[....]

Thanks, just what I've been looking for :o)
Nov 20 '05 #11
MSysobjecst is not permiitted to access from outside.
What do i have to do to access it and get the table names

USMAN

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #12
Hi,
Use the oledbconnection classes getoledbschematable method.
Dim strConn As String

Dim conn As OleDbConnection

strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"

strConn &= "Data Source = Northwind.mdb;"

conn = New OleDbConnection(strConn)

conn.Open()

Dim dtTableNames As DataTable

dttablenames = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _

New Object() {Nothing, Nothing, Nothing, "TABLE"})

conn.Close()

Dim dr As DataRow

For Each dr In dtTableNames.Rows

Trace.WriteLine(dr.Item("TABLE_NAME"))

Next

Ken

----------------------

"muhammad usman" <ro*****@hotmail.com> wrote in message
news:eB**************@TK2MSFTNGP15.phx.gbl...
MSysobjecst is not permiitted to access from outside.
What do i have to do to access it and get the table names

USMAN

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #13

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

Similar topics

0
by: Jesse | last post by:
Hi all, I need some help with Access database and Postgres Database i am trying to link some Acces tables to Postgres tabels but id doesn't seem to work. I have a Postgres running on a server...
5
by: Jamie Pittman via AccessMonster.com | last post by:
I have two tables with 5000 entries on them. One is based for regular time with several variables example (employee name, date,time in and out, code, customer, building) I have another table that...
3
by: Marco de Vries | last post by:
I used to work a lot with Access and created many access databases One thing I'm missing right now is the Access Datagrid displayed when you open a table I looked at a lot of datagrids and read...
3
by: Decreenisi | last post by:
Hi, I have to convert an existing spreadsheet for rejects into an access database. My problem is I use a load of lookup tabels in excel. How do I approch this in access. Also, just a general...
6
by: SEFL | last post by:
Hi there, I'm trying to write a VBS that accesses a local database on my system (personal project). I'm running Windows XP 64-bit with Access XP. Every time I try to access the database on...
0
by: Spooks | last post by:
Hi Leute, hier mein kleines Problem: Ich möchte die Tabellen eines SQL Servers auslesen und anschließend die Daten der Tabellen in die Tabellen der Access Datenbank schreiben! (Die Access...
0
by: sho | last post by:
I want to convert all my access tables into sql file, with this sql file i can convert into MYSQL table format, Just by selecting that access database, How do i extract all those access tables in vb
23
by: Darin | last post by:
Since there is no 64-bit Jet (MS Access) OLEDB driver, what is the recommended solution for this delimma. Our application uses SQL Server as the daatabase engine, but we have about 5 meg of...
4
by: ypper2001 | last post by:
Can anybody point me in the right direction? I have created a small db that I am distributing to the people I work with. It is a read only db with some what sensetive informasjon if you could pull...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.