G
Guest
I am writing a small Access 2000 application. I have an Access 2000 book that
uses a class type named "ADOX.Catalog" that I want to use in my application.
However I get an error when I try to use the code:
Sub RunParameterQuery(datStart As Date, datEnd As Date)
Dim cmd As ADODB.Command
Dim rst As ADODB.Recordset
Dim tempcat As ADOX.Catalog
Set tempcat = New ADOX.Catalog
tempcat.ActiveConnection = CurrentProject.Connection
Set cmd = New ADODB.Command
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "Select * from JOCWCStudent " & _
"Where Date Between ? and ?"
cmd.CommandType = adCmdText
tempcat.Views.Append "qryWeekly", cmd
tempcat.Views.Refresh
Set rst = cmd.Execute(Parameters:=Array(datStart, datEnd))
rst.Close
Set tempcat = Nothing
Set rst = Nothing
Set cmd = Nothing
End Sub
The piece of code that gives me an error is the statement:
Dim tempcat As ADOX.Catalog
The error message itself is in a small Window and says:
Compile error
User defined type not found
I know what the error message means, it is not recognizing the ADOX.Catalog
data type. This data type is used in my Access 2000 book repeatedly. I tried
using a zero and a capital "O". It gave me an error both ways. I could not
find this class type in the object viewer. However, it used repeatedly in the
text.
I am using MS Access 9.0.2720
Is the "ADOX.Catalog" a valid type? It is used in my text repeatedly. Can
anybody help me?
uses a class type named "ADOX.Catalog" that I want to use in my application.
However I get an error when I try to use the code:
Sub RunParameterQuery(datStart As Date, datEnd As Date)
Dim cmd As ADODB.Command
Dim rst As ADODB.Recordset
Dim tempcat As ADOX.Catalog
Set tempcat = New ADOX.Catalog
tempcat.ActiveConnection = CurrentProject.Connection
Set cmd = New ADODB.Command
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "Select * from JOCWCStudent " & _
"Where Date Between ? and ?"
cmd.CommandType = adCmdText
tempcat.Views.Append "qryWeekly", cmd
tempcat.Views.Refresh
Set rst = cmd.Execute(Parameters:=Array(datStart, datEnd))
rst.Close
Set tempcat = Nothing
Set rst = Nothing
Set cmd = Nothing
End Sub
The piece of code that gives me an error is the statement:
Dim tempcat As ADOX.Catalog
The error message itself is in a small Window and says:
Compile error
User defined type not found
I know what the error message means, it is not recognizing the ADOX.Catalog
data type. This data type is used in my Access 2000 book repeatedly. I tried
using a zero and a capital "O". It gave me an error both ways. I could not
find this class type in the object viewer. However, it used repeatedly in the
text.
I am using MS Access 9.0.2720
Is the "ADOX.Catalog" a valid type? It is used in my text repeatedly. Can
anybody help me?