Public Sub CreateQuery() Dim cat As New ADOX.Catalog Dim cmd As New ADODB.Command Dim strSQL As String ' Open the catalog cat.ActiveConnection = _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Northwind.mdb;" ' Create the SQL string strSQL = "SELECT * FROM Categories" ' Create the query by creating a new Command object. cmd.CommandText = strSQL ' Add the new query cat.Views.Append "AllCategories", cmd ' Close the catalog object. Set cat = Nothing End Sub