ADOX performance problem: first attempt to read value from open ADOX catalog lasts long time

L

lampi

Why does this function (see below: opening the ADOX catalog and
retrieving number of tables, views and procedures) last that long?


MS Access 2002 SP2
Windows XP
on a P4, database on local harddisk

Thanks for any hints
Bernd


Sub foo()
Dim cADOXcat As ADOX.Catalog
Dim l As Long
Dim t As Long

Set cADOXcat = New ADOX.Catalog
cADOXcat.ActiveConnection = CurrentProject.Connection

Debug.Print "cADOXcat.Tables.Count: ",
t = Timer
l = cADOXcat.Tables.Count
Debug.Print Timer - t; " "
l = cADOXcat.Tables.Count ' 2nd and further accesses fast!

Debug.Print "cADOXcat.Views.Count: ",
t = Timer
l = cADOXcat.Views.Count
Debug.Print Timer - t; " "

Debug.Print "cADOXcat.Procedures.Count: ",
t = Timer
l = cADOXcat.Procedures.Count
Debug.Print Timer - t; " "

' ...

Set cADOXcat = Nothing
End Sub


cADOXcat.Tables.Count: 17,5546875
cADOXcat.Views.Count: 18,7734375
cADOXcat.Procedures.Count: 18,7734375
 

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