Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

ADOX.Catalog Reference?

which module or reference should i choice so that ADOX.Catalog can be available?

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Hey all,

I borrowed some code that allows my Excel VBA macro open an Access Database Session and create records. The object the borrowed code uses comes from ADOX.Catalog and my Internet searches are turning into goose chases. I just want to know what roll ADOX plays in my routine.
The other thing is the borrowed code only works if MDAC 2.8 is installed. Searching on this made me even more confused. What is an MDAC and what does it have to do with VB?
The instantiation of the connection object is copied below. A third related question would be what does Microsoft.JET.OLEDB.4.0 do for the same code?

Thanks for help,


Dim cat As New ADOX.Catalog
Dim tbl As New ADOX.Table
Dim conn As New ADODB.Connection
Dim rst As New ADODB.Recordset

Dim looprange As Range
Dim currcell As Range

With conn
' Set the OleDB provider for the connection.
.Provider = "Microsoft.JET.OLEDB.4.0"
' Open a connection to Stopping Distance Database.mdb.
'.Open "\corpsv06common!!StabilityBackup DataStopping Distance Database.mdb"
.Open "\corpsv01PlanningCHASINFOSTOPPING DISTANCEStopping Distance Database.mdb"
End With

' Set the active connection for the Catalog object.
cat.ActiveConnection = conn

With rst
.ActiveConnection = conn
' Open the Necessary table, LockType argument of the Open method must be set to adLockOptimistic
' in order add records to the table.
.Open "A97_CWO_Results", LockType:=adLockOptimistic

End With

ITtoolbox Portal for Visual Basic -


I am trying to use ADOX.catalog (on VBA Access 2000) to read the Users
collection. My problem is that when I make the Catalog.activeConnection to
the CurrentProject.Connection I can't read it because it's opened on
ShareDenyNone mode. So I haven't any permission to access to database.

My Question is : How to change the opening mode of my database project to
set my activeconnection.mode to addModeRead ?

thanks for your help.

Adberrazak Kricha.

ADOX And The Catalog.procedures.append
Ok... Im running some basic code that does this

(PSuedo code not a true cut and paste)

For I = 1 to 100
cat.procedures.append "nameofprocedure",cmdCommandObject
'then I do a
'then I do a loop through all the objects in the procedures collection
dim obj as object
for each obj in cat.procedures
txtOutput.text = txtOutput & vbcrlf &

Problem is there aren't any new procedures in my list the only ones that show up are the ones I created through ACCESS. not via code.
However they execute fine if you do an exec queryname and if you try to make another query of that name it won't let you cause ones already there.

Is there something im doing that isnt putting these properly in the procedures collection so I can view them later?

Adox.catalog In Faq Data Report

i ve download a data report from the FAQ (datareport by Deke) eg for column doing in data report....
ive tried at my sql but its bring out errors...
the errors said user type defined not defined at catdb as adox.catalog

can someone tell me y...
is my component dont include the adox library...

Edited by - Shatred on 1/10/2005 8:58:59 PM

Append Outlook Folder To ADOX Catalog
I've tried everything I can think of, and there's nothing on this on Google (that I can find) - everything refers to database files which have a nice simple full filepath.
Studying the properties of a manually created Outlook folder link, here are the differences between the 2 troublesome properties:
New Table Property: "Jet OLEDB:Link Provider String"
Outlook -
"Outlook 9.0;MAPILEVEL=Personal Folders;PROFILE=Microsoft Outlook Internet Settings;TABLETYPE=0;TABLENAME=TLE;"

Access -
"MS Access;Pwd=myLinkPassword"

"MAPILEVEL" is the parent folder tree to the desired folder to link
"TABLENAME" is the name of the actual folder to link to
New Table Property: "Jet OLEDB:Link Datasource"
Outlook -

Access -
App.Path & "myLinkDatabase.mdb

As you can see, the Outlook 'Datasource' is a truncated path to the active profile's temp folder.
Some examples I've seen don't even include that argument - I've tried with and without, using the full path and the actual value as shown...

'creates a new linked table to the current database
Private Function LinkedTable_ADOXNew(ByVal strLinkProvider As String, _
ByVal strTableName As String) As Boolean
Dim catParent As ADOX.Catalog
Dim tblAppend As ADOX.Table

Const TBLPROPERTY_LINKED As String = "Jet OLEDB:Create Link"
Const TBLPROPERTY_PROVIDER As String = "Jet OLEDB:Link Provider String"
Const TBLPROPERTY_NAME As String = "Jet OLEDB:Remote Table Name"
Const TBLPROPERTY_SOURCE As String = "Jet OLEDB:Link Datasource"

On Error GoTo ErrorH

LinkedTable_ADOXNew = False

'create refernce to Current Db
Set catParent = New ADOX.Catalog
catParent.ActiveConnection = CurrentProject.Connection
Set tblAppend = New ADOX.Table

'assign table properties
With tblAppend
.Name = strTableName
Set .ParentCatalog = catParent

.Properties(TBLPROPERTY_PROVIDER) = strLinkProvider
.Properties(TBLPROPERTY_NAME) = strTableName
.Properties(TBLPROPERTY_LINKED) = True

'##### - CHANGE ME TO FIT YOUR PROFILE'S "Local SettingsTemp" FOLDER #####
End With

With catParent.Tables
.Append tblAppend
End With

LinkedTable_ADOXNew = True

On Error Resume Next
Set tblAppend = Nothing
Set catParent = Nothing
Exit Function

MsgBox Err.Description
Resume Finish

End Function
Of course it may be that it's not the property settings that are the problem
Any advice gratefully recieved

Union Query Not Viewable Through ADOX Catalog
Set AdoCon = CurrentProject.Connection
Set AdoCatalog = New ADOX.Catalog
Set AdoCatalog.ActiveConnection = AdoCon
Set AdoView = AdoCatalog.Views("query1")
Set AdoCommand = AdoView.Command
In where query1 is a Union query, and seems not to be viewable. If i change it to a regular select query it's back in the catalog. Is this a bug or is there a good reason for this ?


How To Get Crosstab Queries In ADOX Catalog.Tables

Does anyone know how to get a list of tables/queries from a MS ACCESS database using ADOX that includes any CROSSTAB QUERIES?

I have the following code, but crosstab queries are missing:

  Dim objCat as ADOX.catalog
  Dim objTable As ADOX.Table
  Dim GetTableList As String
  Set objCat = New ADOX.catalog
  objCat.ActiveConnection = m_connection_string
  For Each objTable In objCat.Tables
    If Left(, 4) <> "MSys" Then
      GetTableList = GetTableList + + ","
    End If
  GetTableList = Left(GetTableList, Len(GetTableList) - 1)
  Set objTable = Nothing
  Set objCat = Nothing

Any help would be appreciated.....


Edited by - philp9 on 6/26/2003 1:47:03 AM

ADOX Reference
I would like to use this to create my .mdb on the fly... however, which reference do I need to include? I don't see anything in the list that says "Microsoft ADOX..."
And this type is not is not showing up in the list as I attempt to define my variable.


CD Catalog [!VB]
Hi guys,

This is not a vb question.

I wanted to know, are there any good (read free) CD catalogs available which not only inex the file names but also read through the index or readme file of the CD and classify according.



Sql Server And Catalog
Hi, can anyone tell me how can I create
catalog in microsoft sql server.

I have a program that uses tables, and the first time I start it it should create these tables.
However they should be kept in a catalog.
The problem is that I could'nt manage to create one.
Anyone have a hint?

Hi all.
I'm currently writing an application framework for use with Access 2000, and in that respect, I need to (in code) to get the owner of the current database file.

According to all manuals, the proper way to do this, is to use the method "getObjectOwner()", with NULL as the object name, and adPermObjDatabase
as the object type:

'' This function displays a messagebox indicating who is the owner
'' of the current project.
'' @author PGD, Oct 99
public Sub DisplayOwner()
Dim myCatalog as new ADOX.Catalog
Dim myString as string

myString = ""

With myCatalog
.ActiveConnection = currentproject.Connection
myString = .GetObjectOwner(null, adPermObjDatabase)
End With

msgbox "The owner of this database file is " & myString, vbOkOnly
End Sub

I keep getting "invalid use of Null" when I try to do this. The manuals
state that it should work. My version of ADO is 2.1

Any help given would be greatly appreciated!

Pedro G. Dias
Oslo, Norway

Catalog File Format
Hi ppl.

Does anyone have any ideas on where to begin with writing a catalog file format? I have never really done any file i/o, as I am normally a database app writer. However I don't think that an Access table is going to quite cut this one!

I am starting to write a CD catalog system, whereby I can take a CD, obtain it's media ID number and serial number, (which can be combined into an access key), and then scan the entire file listing into a structure in memory. Once there, I want to somehow store this information, preferably with the ability to store a number of other CD scans too.

Any ideas on how this might be approached.

Thanks for the great forum, and I hope to be able to spend a bit of time here!


Database Catalog For SQL Server...
Hello All,
There is a way to query a SQL server db through ADO to get a listing of all the tables and thier associated fields, sizes, types, ect. ad nauseum.

Can somebody please let me know what that is??

Thanx In Advance,

System Catalog And SQL Server DB
Im trying to get a list of tables that are currently inside of a SQL Server DB. I have made a connection to the database server just fine but cannot access the system catalog to get a list of the tables inside of the database. My question is how to I get a list of the tables that are inside of my database in a SQL Server?


Treeview && Listview Catalog
Please anybody help me. I've started to make some treeview database catalog and now don't know what to do. If anybody know how to write this code ,please send me.
I want to database loads into treeview with 5 nodes, each to be child node of a previous node. Something like this:

And when i click on the last child node, i want to list of something (for example list of mp3 music) loads from database into a listview.
I am using VB6.
Sorry because my bad english but I hope you will understand.
Please Help Me.

Help On Creating A Digital Catalog
Hi there, I have an exercise that consists of creating a catalog that shows a set of items, each with its own ID, a picture and descriptive text......

Basically you start the thing, choose the kind of items you want to see and then start some kind of slideshow....

The only condition is:

1- The files must be packed within the program, so that no images can be used outside it.

I'm really really really new to this, I've thought of everything from databases to control arrays..... and its really really simple... I just don't know where to start


Looking For A Icon Catalog Tool
I had befor upgrading to 2K a tool wich scanned the whole network/drive
for *.ico and stored the icons as thumbnails in a cataloge.

Does some one has a clue what I am talking of.

Any pointing to a tool like this (Freeware)

Thanks in advance

Catalog Transaction Complete?
Using the following code, how can I check to see that it is complete?

I attempt to use the view in an SQL statement just after it and it says it cant find it but when I choose to debug then it's there because time has passed and it has been processed.

    Dim cat As New ADOX.Catalog
    Dim cmd As New ADODB.Command
    cat.ActiveConnection = cnMain
    cmd.CommandType = adCmdText
    cmd.CommandText = "SELECT * From Table1"
    cat.Views.Append "tmpView", cmd

I have tried testing the cat.Views.count as well as looking for the view name in cat.Views but even when they are true it still is not available for a little while.

I would like to do this without JRO


Initial Catalog Value Is Not Changing
Hi, In class module I have created public property procedures Data source name, userid , password and databse name. In a sample form I am assigning for value for that. Initial Catalog = Databasename. First time it is executed, Second time I changed the value for datasourcename and database name. While running the project, datasource name value is changed but initial catalog values remain same.
Can any please tell me the reason.

Automate Word From VB To Create Catalog
Hiya All

Does anyone has/know a sample codes how to automate word from vb to create catalog document type?
I know to create form letter & mailing label but got stuck with this one.


How To Change Initial Catalog Of Crystal9 Through VB6??

does anyone know how to change the Initial Catalog of Crystal Report9 by using vb6??

the scenario is that i change my database name then i cant run any report.. thus, the crystal report always look at the previous database.

thanks for your help..

How To Create More Than One Database Using Catalog Object
Hi all,

My requirement is as follows:

In my application, i am having a form called Company Creation. Whenever i created a company i need to create a separate database for that company. For this i used catalog object to create the database in runtime. First time its working fine. When i called the function after that...its giving me the error like Database already exists. So it is not working for creating multiple database.

So how to create more than one database.

Thanks in advance


Urgent--Refreshing A Catalog And Connection
I've having problems with my catalog and connection. What I'm doing is executing sql that takes information from a dbase III file and creates a table in Access to hold it. I then create an index on that new table in Access to use later. My problem is coming when I try to use the index, it keeps telling me that it cannot find the index, but when I look at the indexes collection for the table that the recordset is based on, it's there. If I debug the error and then continue on, it works fine. There must be a way to refresh the connection or something is not being set correctly. I've included the code for ease of understanding.

Here's how I create my catalog and connection objects:

public Const gsDatabaseDirectory as string = "d:PMTemp" 'location of temporary local Access Database
public Const gsAccessConnect as string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & gsDatabaseDirectory & "perfmtrx.mdb"

public gconAccess as new ADODB.Connection
public gcatAccess as new ADOX.Catalog

'Search for the temporary Access Database and delete it if it exists
If Dir(gsDatabaseDirectory & "*.mdb") &lt;&gt; "" then Kill gsDatabaseDirectory & "*.mdb"

'Create a temporary Access Database to work in
gcatAccess.Create gsAccessConnect
gconAccess.Open gsAccessConnect

And then here's the code that brings in the information from a dBase III table and creates the index:

Dim oidxWfIndex as new ADOX.Index

DisplayMsgInStatWin "Gathering Employee Schedule data to a temporary table"
mosSql = "SELECT DISTINCTROW WF.* INTO [" & mosPrefix & "wf MakeTable] FROM WF IN " & Chr(34) & Chr(34) & " [dBase III;DATABASE="
Select Case mosPrefix
Case "L"
mosSql = mosSql & gsLCallDir
Case "G"
mosSql = mosSql & gsGCallDir
Case "S"
mosSql = mosSql & gsSCallDir
Case "R"
mosSql = mosSql & gsRCallDir
Case "A"
mosSql = mosSql & gsACallDir
End Select
mosSql = mosSql & ";] WHERE ((WF.WFDATE Between #" & pdtStartRange & "# And #" & pdtStopRange & "#)) ORDER BY EPID, WFDATE;"
gconAccess.Execute mosSql
DisplayMsgInStatWin "Indexing the temporary table"
mosWfIndex = "EpidWfDate"
With oidxWfIndex
.Name = mosWfIndex
.Columns.Append "epid"
.Columns.Append "wfdate"
End With
gcatAccess.Tables(mosPrefix & "wf MakeTable").Indexes.Append oidxWfIndex
gcatAccess.Tables(mosPrefix & "wf MakeTable").Indexes.Refresh
morsWfTbl.Open mosPrefix & "wf MakeTable", gconAccess, adOpenKeyset, , adCmdTableDirect
morsWfTbl.Index = mosWfIndex

I get the error when I do: morsWfTbl.Index = mosWfIndex, it tells me it cannot find this index, but I can see it in the collection. I've tried setting up a JRO engine and doing a RefreshCache, but this doesn't help my problem. And like I said before, if I debug when the error occurs and then continue directly after that, it works fine. Any suggestions?

Creating A Catalog In Indexing Services Thru Code
I was wondering if it was possible to use code (in either VB or VB.NET) to create and configure catlogs in IS, or if it has to be done manually in Computer Management.



Online Public Access Catalog (OPAC)

Can anyone help me. I am currently working on my design project which is to design a bibliography tool for ms word. For this I need to populate my database (access based) with information from the user as well as from OPACs. Does any one have any idea how I can connect to and search an OPAC remotely. The information retrieved will then be displayed and the user will select the result that will best suit if not precisely match the inital search. This will then be stored in the database.


Fuzzy Logic Inc

Search A FullText Catalog In SQL Server 2005
Code: SELECT d._uidDocumentParent AS 'ParentID',
d.dtDocumentFileUploadDate As 'UploadDate',
d.vChrDocumentName255 As 'Title',
d.vChrDocumentDescription500 As 'Description',
gt.vChrDocumentGroupTypeName50 As 'Type',
t.vChrDocumentTypeName50 As 'Sub-Type',
d.vChrDocumentFileExtension5 AS 'Extension'
FROM tblDocument As d
Join FreeTextTable(tblDocument, *, '*Manual*') AS FTT on d._uidDocumentPK = FTT.[Key]
Left Outer Join tblDocumentType As t On (d._uidDocumentTypeFK = t._uidDocumentTypePK)
Left Outer Join tblDocumentGroupType As gt On (gt._uidDocumentGroupTypePK = t._uidDocumentGroupTypeFK)
The above clip is the query I am trying to run against a FTCatalog to see if it contains any data. The only table in the FTC is tblDocuments. The documents are being held as Images, and Description, Metadata and Document Name are the other fields indexed (Along with the document image columns)...

The above SQL returns three documents, however, I believe they're getting hit on the full word 'Manual'... whenever I input the word 'Ual' or 'Man' nothing is returned, although the search is set up to return anything resembling Manual because of the asterix.

This query, slightly truncated without all the WHERE statements, worked on a SQL Server 2003 machine... so... what am I doing wrong with this upgrade?

Edited by - Chickenoodle on 1/30/2007 8:38:12 AM

From My Site, How To Download Updates From Microsoft Win Update Catalog

I have a Site, and from my site, I want to access the windows update catalog ( ) and download the updates to a folder on my machine. It is possible???
Can some one help me with this?


Add Reference Library Crystal Report 9 ActiveX If Not Exist In Reference
I have a problem i want to use crystal report, the problem is when i want to add
crystal report in my reference it did not exist. Can anyone told me the solution for my problem...

Reference To Non-Shared Member Requires An Object Reference Error
I am getting a Reference to Non-Shared Member Requires an Object Reference on the (NorthwindDataSet.Customers) coding below. (NorthwindDataSet.Customers has squiggly Blue Line and Mouse hovered over has this error. Please see coding below. I just do not understand the weird error.
Any help to so I can proceed with my learning of VB. I am trying to learn a section of coding at a time and understand why I am getting these errors. This procedure is trying to filter a row and pull data.

Thanks for any help!


Private Sub btnCustomersFind_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnCustomersFind.Click

Dim filteredView As Data.DataView = _
New Data.DataView[B](NorthWindDataSet.Customers)

End Sub
End Class

Error Reference to a non-shared member requires an object reference is appearing on: NorthWindDataSet.Customers and has blue line underneath indicating the error in yellow.

Reference To A Non-shared Member Requires An Object Reference?
This is my code

Public Class Form1
Public Class Form1
Dim WebBrowser1 As WebBrowser
Dim url As String
Private Sub Form_Load()
url = ""
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, ByVal URL As Object)
TextBox1.Text = WebBrowser1.Document.body.outerText
End Sub
End Class
End Class

Can anyone tell me why im getting this error? Thanks.

Deleting A Reference From The Reference Library
How do I delete a reference from VB's reference library?

Getting Reference Path From The Reference Dialog Box
I am developing on VB5. Toward to bottom of the references dialog box there is a Location field that contains the path to the currently selected reference in the list box. The problem I am encountering is that the text box that holds the path does not wrap if the pathname exceeds the size of the textbox. The path is getting cut off and I can not view the end of it, and it is imperative that I do.

I have tried selecting the reference in the list box and select browse... button inthe hopes that the dialog box will navigate to the directory of the selected reference. But this is not the case.

Can anybody provide any suggestions on how to get this path. Is there a patch that will wrap the textbox? Does the textbox wrap in VB6?

Thanks in advance for any help.

Tables Catalog Includes Access System Tables
I'm using ADO with the code below to load table names from an Access database into a Listbox. When I get the names using ADOX.Catalog, inaddition to the User tables, I'm getting all the hidden system tables, MSysACEs, MSysModules, etc. How can I gather only User Tables?

Thanks in advance.

    rsData.ActiveConnection = strConnect
    'Get tables catalog in active connection and load list of tables in Listbox
    Set adCat = New ADOX.Catalog
    adCat.ActiveConnection = rsData.ActiveConnection
    For intTabCount = 0 To adCat.Tables.Count - 1
        lstTables.AddItem adCat.Tables(intTabCount).Name

--If life serves you lemons...
Ask for salt and a bottle of tequila


I'm trying to create a db through code and am running into some problems with setting some attributes, like defaults. Here's my code where the table is created:

'Deck Table''''''''''''''''''''''''''''''''''''''
With Deck
Set .ParentCatalog = objcat
.Name = "Deck"
.Columns.Append "ProjectID", adVarWChar, 50
.Columns.Append "DeckName", adVarWChar, 50
.Columns.Item("Deckname").Properties.Item("default") = "***"
.Columns.Item("ProjectID").Attributes = adColNullable
End With
objcat.Tables.Append Deck

I get the error: "Application uses a value of the wrong type for the current operation"

Anybody know what's wrong? Is it the syntax?

hello i've just finished researching on the net about how to alter a database structure (Access). What i found is this ADOX thing. I tried it in my code and it seems to be very easy to use. This is useful when you want to update the table structure of your database without re-creating the whole thing. My question is, is ADOX the "best" solution for this kind of thing?

What are the advantages & disadvantages of using ADOX?

Hi, Pls see the code below: This code will loop thro the database and list all the tables in a treeview
I want to rewrite this code in ADO. Someone suggested me to go for ADOX object. Can someone guide me as to how to do this.

Thanks for any help.

FileName="C: est.mdb"
Dim tables As TableDefs
Dim tvwnode As Node

tvwTables.Indentation = 200
lvwFields.View = lvwReport

Label3.Caption = FileName

'Set tvwnode = tvwTables.Nodes.Add(, , "m", "ACCESS ENGIN")
'tvwnode.Image = "car"

Set db = OpenDatabase(FileName) 'Venkat

For i = 0 To db.TableDefs.Count - 1
If db.TableDefs(i).Attributes = 0 Then
Set tvwnode = tvwTables.Nodes.Add(, , "TABLE" & Trim(Str(i + 1)), db.TableDefs(i).Name)
tvwnode.Image = "car"
End If
Next i
'The first item will always be selected in the tree view
If tvwTables.Nodes.Count > 0 Then
tvwTables.Nodes(1).Selected = True 'shankar
Call tvwTables_NodeClick(tvwTables.Nodes.Item(1))

End If
'The node click event will be fired so that all records will be displayed automatically
'in the list view.

I am using ADOX to create a table structure with 20 or so fields and then I write that to a flat file with the rs.Save method and ATDG file format. The problem is it says the table is too large. Am I not allowed to add even 20 fields? That sounds a little unbelievable.


I recently installed ADO 2.7. However, the version of ADOX is still 2.1 Is there a separate installation for ADOX?

If anyone ever used ADOX, how do you create a relationship in an Access database?

What the hell is it?

Adox ?
Hmm.. Looks like the db's acting up again.

What Is This Adox

Hi Everybody,

What is the difference between ADO and ADOX? What is the latest version of ADOX? and what is MDAC?



Hi everyone

Im getting a strange error when creating a database using ADO on a win 98 workstation

running the same code on win2k works just fine

Heres the deal it seems to create the database ok on the win98 platform but cannot read or write to it

Does anyone know of anything I have to be aware of when using ado on a win 98 platform?

any help would be appreciated

Thanks everyone

Adox ?

what does ADOX gives me that ADODB doesnt?

I Need To Know DAO Or ADOX
I have fiqured out how to use ADOX to add indexes to Access database columns through code, but I am having trouble extending the length of a text field column from 10 characters to 13 characters. I read an article that says how to do this through DAO, but I would really like to do it through ADOX if possible.

Here is my code:

Private sub Update()

'Update the veh. License column

End Sub

Private Sub UpdateCol(ByVal strDBPath As String, _
ByVal strTableName As String, _
ByVal strCol As String)

Dim catDB As New ADOX.Catalog
Dim col As New ADOX.Column
Dim tbl As New ADOX.Table

On Error Resume Next

catDB.ActiveConnection = "Provider=Microsoft.JET.OLEDB.4.0;" & _ "Data Source=" & strDBPath

With tbl
.Name = strTableName
Set .ParentCatalog = catDB
With .Columns
.Item(strCol).Properties("FieldSize") = 13
End With
End With

End Sub

***So this doesn't work, does anyone know why or whynot???

i have a recordset from an oracle database and i want to create a new access database with the results of the the recordset inside, i know there is a way to do that with ADOX but have no idea how to start .

any help would be appreciated

where can i get adox 2.6?

any tuturials on using ADOX hanging around?

Copyright 2005-08, All rights reserved