473,563 Members | 2,667 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List MS Access Queries from VB.NET

So, I've found how to list all the tables in an Access database (as
seen below) and running MS Access queries is easy (similar to
executing a stored procedure), but how do I list the names of all of
the queries in the access database?
'RETURNS: ARRAYLIST OF ALL TABLES IN A DATABASE
Dim objDataTable As DataTable =
cn.GetOleDbSche maTable(OleDbSc hemaGuid.Tables , _
New Object() {Nothing, Nothing, Nothing, "TABLE"})

Dim arrListTables As New ArrayList
Dim i As Integer
For i = 0 To objDataTable.Ro ws.Count - 1
arrListTables.A dd(objDataTable .Rows(i)(2))
Next
thanks,
Kev
Nov 20 '05 #1
3 4171
* ke*********@yah oo.com (Kevin Forbes) scripsit:
So, I've found how to list all the tables in an Access database (as
seen below) and running MS Access queries is easy (similar to
executing a stored procedure), but how do I list the names of all of
the queries in the access database?


Notice that a separate group for ADO.NET related question is available:

<news://msnews.microsof t.com/microsoft.publi c.dotnet.framew ork.adonet>

Web interface:

<http://msdn.microsoft. com/newsgroups/default.asp?url =/newsgroups/loadframes.asp? icp=msdn&slcid= us&newsgroup=mi crosoft.public. dotnet.framewor k.adonet>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #2
Hi Kev,

You can use the following to get the Queries.

Dim objDataTable As DataTable =
cn.GetOleDbSche maTable(OleDbSc hemaGuid.Tables , _
New Object() {Nothing, Nothing, Nothing, "VIEW"})

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: ke*********@yah oo.com (Kevin Forbes)
| Newsgroups: microsoft.publi c.dotnet.langua ges.vb
| Subject: List MS Access Queries from VB.NET
| Date: 13 Nov 2003 12:59:42 -0800
| Organization: http://groups.google.com
| Lines: 20
| Message-ID: <25************ **************@ posting.google. com>
| NNTP-Posting-Host: 198.103.172.9
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google. com 1068757182 3810 127.0.0.1 (13 Nov 2003
20:59:42 GMT)
| X-Complaints-To: gr**********@go ogle.com
| NNTP-Posting-Date: Thu, 13 Nov 2003 20:59:42 +0000 (UTC)
| Path:
cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!new sfeed00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.s yr.edu!news.max well.syr.edu!po stnews1.google. com!no
t-for-mail
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:156639
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb
|
| So, I've found how to list all the tables in an Access database (as
| seen below) and running MS Access queries is easy (similar to
| executing a stored procedure), but how do I list the names of all of
| the queries in the access database?
|
|
| 'RETURNS: ARRAYLIST OF ALL TABLES IN A DATABASE
| Dim objDataTable As DataTable =
| cn.GetOleDbSche maTable(OleDbSc hemaGuid.Tables , _
| New Object() {Nothing, Nothing, Nothing, "TABLE"})
|
| Dim arrListTables As New ArrayList
| Dim i As Integer
| For i = 0 To objDataTable.Ro ws.Count - 1
| arrListTables.A dd(objDataTable .Rows(i)(2))
| Next
|
|
| thanks,
| Kev
|

Nov 20 '05 #3
Thank you, that works perfectly.

I will post in the appropriate newsgroup next time.
-----Original Message-----
Hi Kev,

You can use the following to get the Queries.

Dim objDataTable As DataTable =
cn.GetOleDbSch emaTable(OleDbS chemaGuid.Table s, _
New Object() {Nothing, Nothing, Nothing, "VIEW"})
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers norights."

--------------------
| From: ke*********@yah oo.com (Kevin Forbes)
| Newsgroups: microsoft.publi c.dotnet.langua ges.vb
| Subject: List MS Access Queries from VB.NET
| Date: 13 Nov 2003 12:59:42 -0800
| Organization: http://groups.google.com
| Lines: 20
| Message-ID: <25************ **************@ posting.google. com>| NNTP-Posting-Host: 198.103.172.9
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google. com 1068757182 3810 127.0.0.1 (13 Nov 200320:59:42 GMT)
| X-Complaints-To: gr**********@go ogle.com
| NNTP-Posting-Date: Thu, 13 Nov 2003 20:59:42 +0000 (UTC)
| Path:
cpmsftngxa06.p hx.gbl!TK2MSFTN GP08.phx.gbl! newsfeed00.sul. t-online.de!t-online.de!news-spur1.maxwell.s yr.edu!news.max well.syr.edu! postnews1.googl e.com!not-for-mail
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:156639| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb
|
| So, I've found how to list all the tables in an Access database (as| seen below) and running MS Access queries is easy (similar to| executing a stored procedure), but how do I list the names of all of| the queries in the access database?
|
|
| 'RETURNS: ARRAYLIST OF ALL TABLES IN A DATABASE
| Dim objDataTable As DataTable =
| cn.GetOleDbSche maTable(OleDbSc hemaGuid.Tables , _
| New Object() {Nothing, Nothing, Nothing, "TABLE"})|
| Dim arrListTables As New ArrayList
| Dim i As Integer
| For i = 0 To objDataTable.Ro ws.Count - 1
| arrListTables.A dd(objDataTable .Rows(i)(2))
| Next
|
|
| thanks,
| Kev
|

.

Nov 20 '05 #4

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

Similar topics

2
2267
by: Waxabi X | last post by:
I created a view on an Access 2002 database through an ODBC query tool. The view works fine either through ODBC or the Access IDE. The problem I am having is that it does not show up in the Queries list on the Access IDE. It's almost as if ODBC did not write a portion of the data dictionary or something.. quite odd. Has anyone heard of this...
1
2760
by: Melissa Kay Beeline | last post by:
OK, here's the sitch : we have an access control system at work that registers ever entry/exit of every employee. I recently made some queries in Access so the ppl in HR could make reports (who came in late, how many ppl were undertimed, etc etc) Now they are not satisfied (of course) and they want a list of ABSENT employees. I have the...
3
2433
by: jallegue | last post by:
I am would like to get the list of queries that make a macro in MS-Access using vb 6.0.
2
1842
by: Eric | last post by:
I have an Access 95 database. This database has run for years and now is giving me a problem. When opened, the switchboard works fine and the database functions. However, when I close the switchboard and try to open a table, query or report, the tabs show up for table, query, report and etc. However, the white box that lists the names of the...
3
2835
by: iht | last post by:
Say I have a database with types of car driven by people living in different cities. I made several queries to separate out the database according to city, then made queries to count out numbers of cars. So what I have now are queries those tally different car types in each city (simplified version): LAQuery 50 5 10 15 20 ...
4
64549
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one determines the available options in the other. TERMINOLOGY Row Source: The table/query from which the Combo Box or List Box gets its values. Note:...
5
1677
by: JvC | last post by:
Background Access 2003. MDB Front End. I am populating a list box with the names of queries in the system. I am searching for strings in the query names and then creating a value list for users to select from. Problem My users occasionally use commas in query names. When I move the value list to the RowSource of the list box, the commas...
0
7659
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7580
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...
0
7882
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7634
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...
0
6244
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...
1
5481
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...
0
3634
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...
1
2079
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
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.