Here is how you get a list of queries in an Access mdb from a vb6 app
(this works the same in a vb.net app except that you have to cast the
Access Object using CType or DirectCast):
First you need to make a reference to the Microsoft Access X Object
Library, then make another reference to the Microsoft DAO 3.x Object
Library
then add this code
Private Sub Command1_Click( )
Dim accObj As Access.Applicat ion, QD As QueryDef
Dim DB As Database
Set accObj = GetObject("C:\t est.mdb", "Access.Applica tion")
'or if you use CreateObject then need to open current DB
'accObj.OpenCur rentDatabase ("C:\test.md b")
Set DB = accObj.CurrentD b
For Each QD In DB.QueryDefs
Debug.Print QD.Name
Next
End Sub
Rich
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!