Why does Cat.Views.Count seem to execute a query

A

AnExpertNovice

When cat.views.count is executed in Immediate mode or from code there are
two functions (referenced by various queries) that are executed.

WHY???


In two functions two lines were added after the Dim statements and before
any code... those lines were:
Debug.print "<function name> executed"
GoTo ExitRoutine


Here is the executed code. The error routine was pared down to make it
shorter and it is not being hit.

Private Sub CheckCatForTestingOnly()
On Error GoTo ErrorRoutine
Dim intViewsCount As Integer
Dim intSub1 As Integer
Dim cnnerr As ADODB.Error
'objects
Dim cat As New adox.Catalog
Dim cnn As New ADODB.Connection

Set cnn = CurrentProject.Connection

'Open the catalog
cat.ActiveConnection = cnn

'How many Views
Debug.Print cat.Views.Count & " Views exist.... this time"
ExitRoutine:
On Error Resume Next
Set cat = Nothing
Set cnn = Nothing
Debug.Print "Done"
Exit Sub
ErrorRoutine:
[Snip]
Resume ExitRoutine
End Sub


=========here are the results
fnGetReportEndDate executed
fnGetReportStartDate executed
fnGetReportEndDate executed
fnGetReportStartDate executed
fnGetReportEndDate executed
fnGetReportStartDate executed
fnGetReportEndDate executed
fnGetReportStartDate executed
fnGetReportEndDate executed
fnGetReportStartDate executed
fnGetReportEndDate executed
fnGetReportStartDate executed
fnGetReportEndDate executed
fnGetReportStartDate executed
fnGetReportEndDate executed
fnGetReportStartDate executed
fnGetReportEndDate executed
fnGetReportStartDate executed
fnGetReportEndDate executed
fnGetReportStartDate executed
fnGetReportEndDate executed
fnGetReportStartDate executed
fnGetReportEndDate executed
fnGetReportStartDate executed
8 Views exist.... this time
Done


[If needed here are the references in the order searched]
Visual Basic For Applications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.7 Library
Microsoft ADO Ext. 2.7 for DDL and Security
SCS02
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top