473,769 Members | 5,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I create a list of another database's objects?

Hello

I am trying to connect to a msaccess database and then create a list of the
objects in that database (more specifically the tables) and then create a
list of the fields (including the field type) for each table.

How can I do this?

Thanks

G Gerard
Mar 26 '07 #1
2 2023
On Mar 25, 7:50 pm, "G Gerard" <gger...@nbnet. nb.cawrote:
Hello

I am trying to connect to a msaccess database and then create a list of the
objects in that database (more specifically the tables) and then create a
list of the fields (including the field type) for each table.

How can I do this?

Thanks

G Gerard

You should be able to get at the different collections through the
database object (assuming DAO) like you would using CurrentDB.

Set db = (method of opening/creating database)
db.TableDefs()
db.QueryDefs()
db.Documents("F orms").Document ()

and so on.

May I ask why?

Mar 26 '07 #2
OpenDatabase() on the file name.
Table names are in MSysObjects.
Loop through the TableDefs to show the field names and types.

An example of how to list the fields, types, and descriptions for tables:
http://allenbrowne.com/func-06.html

This is a more comprehensive example:
http://allenbrowne.com/AppIssueChecker.html
Illustrates how to:
- choose a database, and OpenDatabase;
- loop through the TableDefs, and examine each field, including the names
and properties of the database, tables, and fields;
- do a bunch of other stuff as well.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"G Gerard" <gg*****@nbnet. nb.cawrote in message
news:KN******** ************@ur sa-nb00s0.nbnet.nb .ca...
>
I am trying to connect to a msaccess database and then create a list of
the objects in that database (more specifically the tables) and then
create a list of the fields (including the field type) for each table.
Mar 26 '07 #3

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

Similar topics

3
1987
by: kyle.tk | last post by:
So I have a central list of python objects that I want to be able to share between different process that are possibly on different computers on the network. Some of the processes will add objects to list and another process will be a GUI that will view objects in the list. I want this all to happen in real-time (e.g once a processes adds an object to the list the GUI will see it.) What would be the best way to accomplish this. Some of...
7
8869
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
10
1970
by: Lars Grøtteland | last post by:
Hello! Was wondering how I can create a copy of one database? FYI I'm not interrested in the data, just the fields and triggers, and so on. Which way is the easiest? Do I create a script and run it from there? Is it smart to have it inside a SP? Any idea would be greatly appreciated.
8
2275
by: ASP Yaboh | last post by:
I have an ArrayList of data gathered from a database. I want to create a web page from this data by creating a <table>, each cell in each row displays the appropriate data. One of those cells in each row needs a <textarea> control. The background supporting classes are completed, the only task left now is to create the web page. I am at a loss on how to create the table in the page populated by the data. Previously, I would have just...
2
2135
by: Markus Prediger | last post by:
Hi NG, I have an asp.net project that uses an vb6 com object for some database-manipulation (I cannot rewrite it in .net, sorry, its not my decision). I want it to be instanciated seperately for each session, so that three users can connect to three different databases. But I get crazy because: -With interop all users share one instance - pure chaos (the instance is
9
1874
by: James Radke | last post by:
Hello, I would like to create a sorted listbox which has one property that I can set to true or false to show if the listbox should be sorted (I may potentially add another one for the sort direction - asc, or desc). Then, if it should be sorted, everytime an item is added to the list via Items.Add or or deleted via items.remove, I would like it to automatically resort the list. I have created the base class below... but this only...
1
1574
by: matthew.macdonald-wallace | last post by:
Hi all, I'm trying to add functionality to an app written in C# so that a list of people is displayed in a list box on the left hand side and then selected individuals can be added to another list box on the right-hand side. I've got the data from my database into a database reader and I can get it into an arrayList, however I can't get it to do what I want! :)
23
7416
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these in an array. The application compiles but aborts without giving me any useful information. What I suspect is happening is infinite recursion. Each Directory object creates an array of Subdirectories each of which has an array of...
2
1655
by: Big Charles | last post by:
Hello, I would like to create an array-class to be able to call like: Dim oMyCar as New MyCar ' After initializing oMyCar, the object has to be like: oMyCar(0).Brand oMyCar(0).Wheels.NumberOfWheels oMyCar(0).Wheels.ColorOfWheels
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5307
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3964
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.