Riddle me this. Slowdown in the IDE

M

MikeB

I'm running a lot of output into a file. Somehow the whole process
seems to slow down:

Here is a log of what I see:
Hello Mike. Today is 9/19/2008 2:44:15 PM
Printing line 50 at 9/19/2008 2:44:19 PM
Printing line 100 at 9/19/2008 2:44:19 PM
Printing line 150 at 9/19/2008 2:44:19 PM
Printing line 200 at 9/19/2008 2:44:19 PM
Printing line 250 at 9/19/2008 2:44:19 PM
Printing line 300 at 9/19/2008 2:44:19 PM
Printing line 350 at 9/19/2008 2:44:19 PM
Printing line 400 at 9/19/2008 2:44:19 PM
Printing line 450 at 9/19/2008 2:44:19 PM
Printing line 500 at 9/19/2008 2:44:19 PM
Printing line 550 at 9/19/2008 2:44:19 PM
Printing line 600 at 9/19/2008 2:44:19 PM
Printing line 650 at 9/19/2008 2:44:19 PM
Printing line 700 at 9/19/2008 2:44:19 PM
Printing line 750 at 9/19/2008 2:44:43 PM
Printing line 800 at 9/19/2008 2:45:07 PM
Printing line 850 at 9/19/2008 2:45:32 PM
Printing line 900 at 9/19/2008 2:45:56 PM
Printing line 950 at 9/19/2008 2:46:20 PM
Printing line 1000 at 9/19/2008 2:46:37 PM
End Run. 1007 lines output.

What is more strange, is that the output to the Immediate window (the
output above) completely halts after the "line 700" output until the
process completes. I see an hourglass and nothing else.

If I use an editor to look at the output file, I can see that output
is being written to it, albeit very slowly. So slowly that I can open
and close the editor several times to look at the contents of the
file.

And no, I don''t think it is opening the editor that slows it down, I
noticed it first, then wrote the code and watched it not perform and
then after that in a subsequent run I used the editor to see if output
gets written to the file.

Thanks.
 
T

Tony Toews [MVP]

MikeB said:
I'm running a lot of output into a file. Somehow the whole process
seems to slow down:

Can you post the code you are using to write the output to a file.

Are you opening and closing the file in between each write?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
M

MikeB

Can you post the code you are using to write the output to a file.

Are you opening and closing the file in between each write?

I'm not opening/closing the file between writes.

I can post the code, but it's kind of a lot (it's probably also badly
written, since I'm not proficient in VBA). Does the ng object to a
large code post? If so I'll look for a website to host the code.
 
T

Tony Toews [MVP]

MikeB said:
I'm not opening/closing the file between writes.

I can post the code, but it's kind of a lot (it's probably also badly
written, since I'm not proficient in VBA). Does the ng object to a
large code post? If so I'll look for a website to host the code.

No objections. But snip out all the non relevant portions. Just give
us the open, looping and write/put statements.

Tony

--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
M

MikeB

No objections. But snip out all the non relevant portions. Just give
us the open, looping and write/put statements.
OK, I will, unfortunately, the writes aren't concentrated, they're
spread all over the code. Right now, on my test DB, this generates
5,900 lines of output and the slowdown seems to happen right at the
end - in the last 100 lines.

I'd also appreciate suggestions on how I could have done this code
better.

Option Compare Database
Option Explicit

Dim intLineCounter As Integer

Sub MapDAO()
Dim intNestLvl As Long
intNestLvl = 0
intLineCounter = 0
Debug.Print "Hello Mike. Today is " & Now()
Open "VBA_Trace.txt" For Output As #1
prStr intNestLvl, "Report date " & Now()
prStr intNestLvl, "Enumerate DBEngine:" & DBEngine.Version()
ListDbeProperties intNestLvl, "DBEngine", DBEngine
MapErrors intNestLvl, DBEngine
MapWorkspaces intNestLvl, DBEngine
Close 1
Debug.Print "End Run. " & intLineCounter & " lines output."

End Sub

Sub MapErrors(ByVal intNestLvl As Long, _
ByVal dbe As DAO.DBEngine)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of Errors: " & dbe.Errors.Count()
Dim ctr As Integer
ctr = 0
Dim err As DAO.Error
intNestLvl = intNestLvl + 1
For Each err In dbe.Errors
ctr = ctr + 1
prStr intNestLvl, "Error " & ctr & ": " & err.Description()
prStr intNestLvl + 1, "ErrorNumber: " & err.Number()
prStr intNestLvl + 1, "Errorsource: " & err.Source()
Next err
End Sub

Sub MapWorkspaces(ByVal intNestLvl As Long, _
ByVal dbe As DAO.DBEngine)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of Workspaces: " & _
DBEngine.Workspaces.Count()
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim wkspc As DAO.Workspace
For Each wkspc In dbe.Workspaces
ctr = ctr + 1
prStr intNestLvl, "Workspace " & ctr & ": " & wkspc.name
ListWkspcProperties intNestLvl, wkspc.name(), wkspc
MapDatabases intNestLvl, wkspc
MapGroups intNestLvl, wkspc
MapUsers intNestLvl, wkspc
Next wkspc
End Sub

Sub MapDatabases(ByVal intNestLvl As Long, _
ByVal wkspc As DAO.Workspace)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of Databases in " & wkspc.name() & _
": " & _
wkspc.Databases.Count()
Dim ctr As Integer
ctr = 0
Dim entity As DAO.Database
Dim FullPath As String
Dim DBName As String
Dim CurrentPath As String
intNestLvl = intNestLvl + 1
For Each entity In wkspc.Databases
ctr = ctr + 1
prStr intNestLvl, "Database " & ctr & ": " & entity.name()
FullPath = entity.name
DBName = Mid(FullPath, InStrRev(FullPath, "\", ,
vbBinaryCompare) + 1)
CurrentPath = Left$(FullPath, InStrRev(FullPath, "\", _
, vbBinaryCompare) - 1)
prStr intNestLvl + 1, "DBName: " & DBName
prStr intNestLvl + 1, "CurrentPath: " & CurrentPath
ListDbProperties intNestLvl, DBName, entity
MapContainers intNestLvl, DBName, entity
MapQueryDefs intNestLvl, DBName, entity
MapRecordSets intNestLvl, DBName, entity
MapRelations intNestLvl, DBName, entity
MapTableDefs intNestLvl, DBName, entity
Next entity
End Sub

Sub MapContainers(ByVal intNestLvl As Long, _
ByVal DBName As String, _
ByVal db As DAO.Database)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of Containers in " & DBName & _
": " & _
db.Containers.Count()
Dim ctr As Integer
ctr = 0
Dim entity As DAO.Container
intNestLvl = intNestLvl + 1
For Each entity In db.Containers
ctr = ctr + 1
prStr intNestLvl, "Container " & ctr & ": " & entity.name()
ListContainerProperties intNestLvl, entity.name(), entity
MapDocuments intNestLvl, entity.name(), entity
Next entity
End Sub

Sub MapDocuments(ByVal intNestLvl As Long, _
ByVal name As String, _
ByVal cntnr As DAO.Container)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of Documents in " & name & _
": " & _
cntnr.Documents.Count()
Dim ctr As Integer
ctr = 0
Dim entity As DAO.Document
intNestLvl = intNestLvl + 1
For Each entity In cntnr.Documents
ctr = ctr + 1
prStr intNestLvl, "Document " & ctr & ": " & entity.name()
ListDocumentProperties intNestLvl, entity.name(), entity
Next entity
End Sub

Sub MapQueryDefs(ByVal intNestLvl As Long, _
ByVal DBName As String, _
ByVal db As DAO.Database)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of QueryDefs in " & DBName & _
": " & _
db.QueryDefs.Count()
Dim ctr As Integer
ctr = 0
Dim entity As DAO.QueryDef
intNestLvl = intNestLvl + 1
For Each entity In db.QueryDefs
ctr = ctr + 1
prStr intNestLvl, "QueryDef " & ctr & ": " & entity.name()
ListQueryDefProperties intNestLvl, entity.name(), entity
MapQDFields intNestLvl, entity.name(), entity
Next entity
End Sub

Sub MapQDFields(ByVal intNestLvl As Long, _
ByVal QDName As String, _
ByVal qdf As DAO.QueryDef)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of QD Fields in " & QDName & _
": " & _
qdf.Fields.Count()
Dim ctr As Integer
ctr = 0
Dim entity As DAO.Field
intNestLvl = intNestLvl + 1
For Each entity In qdf.Fields
ctr = ctr + 1
prStr intNestLvl, "QueryDef " & ctr & ": " & entity.name()
ListQDFieldProperties intNestLvl, entity.name(), entity
Next entity
End Sub

Sub MapRecordSets(ByVal intNestLvl As Long, _
ByVal DBName As String, _
ByVal db As DAO.Database)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of RecordSets in " & DBName & _
": " & _
db.Recordsets.Count()
Dim ctr As Integer
ctr = 0
Dim entity As DAO.Recordset
intNestLvl = intNestLvl + 1
For Each entity In db.Recordsets
ctr = ctr + 1
prStr intNestLvl, "RecordDef " & ctr & ": " & entity.name()
ListRecordSetProperties intNestLvl, entity.name(), entity
Next entity
End Sub

Sub MapRelations(ByVal intNestLvl As Long, _
ByVal DBName As String, _
ByVal db As DAO.Database)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of Relations in " & DBName & _
": " & _
db.Relations.Count()
Dim ctr As Integer
ctr = 0
Dim entity As DAO.Relation
intNestLvl = intNestLvl + 1
For Each entity In db.Relations
ctr = ctr + 1
prStr intNestLvl, "Relation " & ctr & ": " & entity.name()
ListRelationProperties intNestLvl, entity.name(), entity
Next entity
End Sub

Sub MapTableDefs(ByVal intNestLvl As Long, _
ByVal DBName As String, _
ByVal db As DAO.Database)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of TableDefs in " & DBName & _
": " & _
db.TableDefs.Count()
Dim ctr As Integer
ctr = 0
Dim entity As DAO.TableDef
intNestLvl = intNestLvl + 1
For Each entity In db.TableDefs
ctr = ctr + 1
prStr intNestLvl, "Relation " & ctr & ": " & entity.name()
ListTableDefProperties intNestLvl, entity.name(), entity
Next entity
End Sub

Sub MapGroups(ByVal intNestLvl As Long, _
ByVal wkspc As DAO.Workspace)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of Groups in " & wkspc.name() & _
": " & _
wkspc.Groups.Count()
Dim ctr As Integer
ctr = 0
Dim entity As DAO.Group
intNestLvl = intNestLvl + 1
For Each entity In wkspc.Groups
ctr = ctr + 1
prStr intNestLvl, "Group " & ctr & ": " & entity.name()
ListGrpProperties intNestLvl, entity.name(), entity
Next entity
End Sub

Sub MapUsers(ByVal intNestLvl As Long, _
ByVal wkspc As DAO.Workspace)
intNestLvl = intNestLvl + 1
prStr intNestLvl, "Number of Users in " & wkspc.name() & _
": " & _
wkspc.Users.Count()
Dim ctr As Integer
ctr = 0
Dim entity As DAO.User
intNestLvl = intNestLvl + 1
For Each entity In wkspc.Users
ctr = ctr + 1
prStr intNestLvl, "User " & ctr & ": " & entity.name()
ListUsrProperties intNestLvl, entity.name(), entity
Next entity
End Sub

Sub ListDbeProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal dbe As DAO.DBEngine)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid DBEngine properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In dbe.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub ListWkspcProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal wkspc As DAO.Workspace)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid Workspace properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In wkspc.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub ListDbProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal entity As DAO.Database)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid Database properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In entity.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub ListContainerProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal entity As DAO.Container)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid Container properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In entity.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub ListDocumentProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal entity As DAO.Document)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid Document properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In entity.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub ListQueryDefProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal entity As DAO.QueryDef)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid QueryDef properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In entity.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub ListQDFieldProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal entity As DAO.Field)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid QDField properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In entity.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub ListRecordSetProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal entity As DAO.Recordset)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid RecordSet properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In entity.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub ListRelationProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal entity As DAO.Relation)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid Relation properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In entity.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub ListTableDefProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal entity As DAO.TableDef)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid TableDef properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In entity.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub ListGrpProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal entity As DAO.Group)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid Group properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In entity.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub ListUsrProperties(ByVal intNestLvl As Long, _
ByVal strTemp As String, _
ByVal entity As DAO.User)
intNestLvl = intNestLvl + 1
Dim ctr As Integer
ctr = 0
Dim prpLoop As DAO.Property

prStr intNestLvl, "Valid User properties in " & strTemp
intNestLvl = intNestLvl + 1
For Each prpLoop In entity.Properties
ctr = ctr + 1
On Error GoTo propertyError
prStr intNestLvl, strTemp & " property " & ctr & " " & _
prpLoop.name & " = " & prpLoop.Value
On Error GoTo 0
nextLoop:
Next prpLoop
Exit Sub

propertyError:
prStr intNestLvl, strTemp & " property " & ctr & " cannot be
listed."
Resume nextLoop
End Sub

Sub prStr(ByVal dots As Long, ByVal str As String)
intLineCounter = intLineCounter + 1
Print #1, String(dots, ".") & str
If (intLineCounter Mod 100) = 0 Then
Debug.Print "Printing line " & intLineCounter & " at " & Now()
End If

End Sub
 
T

Tony Toews [MVP]

MikeB said:
OK, I will, unfortunately, the writes aren't concentrated, they're
spread all over the code. Right now, on my test DB, this generates
end - in the last 100 lines.

Interesting. The slowdown happened for me too.

Printing line 2200 at 2008-09-20 12:47:37 PM
Printing line 2300 at 2008-09-20 12:47:37 PM
Printing line 2400 at 2008-09-20 12:48:19 PM
Printing line 2500 at 2008-09-20 12:49:15 PM
End Run. 2565 lines output.

Note that the CPU was not greater than 2% and the hard drive light was
not flashing. So I have no idea

BTW putting a DoEvents in the prStr will give you back responsiveness
in your system. I've seen this kind of behavior in other "tight" DAO
loops.

Ah, I changed the following line in the prSTR routine to add the time.
That gave me the exact properties causing the slowdown.

Print #1, String(dots, ".") & Time() & " " & str

It was consistently the following properties in the MSys tables.
.........1:09:07 PM MSysACEs property 9 ValidationRule =
.........1:09:07 PM MSysACEs property 10 ValidationText =
.........1:09:11 PM MSysACEs property 11 ConflictTable =
.........1:09:15 PM MSysACEs property 12 ReplicaFilter =
.......1:09:15 PM Relation 6: MSysNavPaneGroupCategories

I'd suggest simply bypassing any tables that start with MSys.
I'd also appreciate suggestions on how I could have done this code
better.

I didn't go through your code to any great detail but a quick glance
shows it to be nice and tight. Looked decent to me.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
M

MikeB

BTW putting a DoEvents in the prStr will give you back responsiveness
in your system. I've seen this kind of behavior in other "tight" DAO
loops.

What does this mean?
Ah, I changed the following line in the prSTR routine to add the time.
That gave me the exact properties causing the slowdown.
I'd suggest simply bypassing any tables that start with MSys.

It's ok, I don't mind printing everything, it's just for kicks anyway.
I didn't go through your code to any great detail but a quick glance
shows it to be nice and tight. Looked decent to me.
gee, now I feel all warm and fuzzy... :)

Actually, I was hoping that there was a method (pun intended) that I
could use to avoid the incredible repetition of the various subs.

Something along the lines of a recursive sub that has as an calling
parameter an object and then a way to interrogate the object to find
out what it was and then cast it as such and so on.... but perhaps
that isn't really possible.

I cannot, for instance, find a way to ask a container (a collection?)
to tell me what objects it has in its collection. For instance, I'd
like the Database object to tell me that it has Containers, QueryDefs,
RecordSets, etc. as collections within it.
 
T

Tony Toews [MVP]

MikeB said:
What does this mean?

Sometimes loops in Access can take over your entire system resulting
in sluggishness in other apps. DoEvents tells Access to let other
things happen.
It's ok, I don't mind printing everything, it's just for kicks anyway.

Sure, but that's your slowdown so ...
gee, now I feel all warm and fuzzy... :)

You're welcome.
Actually, I was hoping that there was a method (pun intended) that I
could use to avoid the incredible repetition of the various subs.

I knew you were going to ask that. said:
Something along the lines of a recursive sub that has as an calling
parameter an object and then a way to interrogate the object to find
out what it was and then cast it as such and so on.... but perhaps
that isn't really possible.

I cannot, for instance, find a way to ask a container (a collection?)
to tell me what objects it has in its collection. For instance, I'd
like the Database object to tell me that it has Containers, QueryDefs,
RecordSets, etc. as collections within it.

Right off hand I can't think of any such either. Not sure I'm going
to get around to thinking too deeply on this topic. <smile> But I'll
ruminate for a few days.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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