P
PR
I want to be able to create a table that contains all the database objects by
name, created date and modify date...
is there a way of doing this... or is there another way to achieve what I am
trying to do...
I have tried to use the following code my it does not pick up all objects or
names...
<<<<<Code Start>>>>>
Function DisplayContainers(strDatabase As String, intCollection As Integer)
As Integer
Dim DefaultWorkspace As Workspace
Dim CurrentDatabase As Database
Dim MyContainer As Container
Dim MyDocument As Document
Dim rst As Recordset
Dim i As Integer
Dim j As Integer
Set DefaultWorkspace = DBEngine.Workspaces(0)
If strDatabase = "" Then
Set CurrentDatabase = DefaultWorkspace.Databases(0)
Else
Set CurrentDatabase = DefaultWorkspace.OpenDatabase(strDatabase)
End If
If intCollection = -1 Then
For j = 0 To CurrentDatabase.Containers.Count - 1
Set MyContainer = CurrentDatabase.Containers(j)
Next j
Else
Set MyContainer = CurrentDatabase.Containers(intCollection)
For i = 0 To MyContainer.Documents.Count - 1
Set rst = CurrentDatabase.OpenRecordset("tlkpMasterContainer s",
dbOpenDynaset)
Set MyDocument = MyContainer.Documents(i)
With rst
..AddNew
!itemName = MyDocument.Name
!itemDateCreate = MyDocument.DateCreated
!itemDateModify = MyDocument.LastUpdated
..Update
End With
Next i
End If
If strDatabase <> "" Then
CurrentDatabase.Close
Set CurrentDatabase = Nothing
End If
DisplayContainers = True
End Function
<<<<<code ends>>>>>
Regards PR
name, created date and modify date...
is there a way of doing this... or is there another way to achieve what I am
trying to do...
I have tried to use the following code my it does not pick up all objects or
names...
<<<<<Code Start>>>>>
Function DisplayContainers(strDatabase As String, intCollection As Integer)
As Integer
Dim DefaultWorkspace As Workspace
Dim CurrentDatabase As Database
Dim MyContainer As Container
Dim MyDocument As Document
Dim rst As Recordset
Dim i As Integer
Dim j As Integer
Set DefaultWorkspace = DBEngine.Workspaces(0)
If strDatabase = "" Then
Set CurrentDatabase = DefaultWorkspace.Databases(0)
Else
Set CurrentDatabase = DefaultWorkspace.OpenDatabase(strDatabase)
End If
If intCollection = -1 Then
For j = 0 To CurrentDatabase.Containers.Count - 1
Set MyContainer = CurrentDatabase.Containers(j)
Next j
Else
Set MyContainer = CurrentDatabase.Containers(intCollection)
For i = 0 To MyContainer.Documents.Count - 1
Set rst = CurrentDatabase.OpenRecordset("tlkpMasterContainer s",
dbOpenDynaset)
Set MyDocument = MyContainer.Documents(i)
With rst
..AddNew
!itemName = MyDocument.Name
!itemDateCreate = MyDocument.DateCreated
!itemDateModify = MyDocument.LastUpdated
..Update
End With
Next i
End If
If strDatabase <> "" Then
CurrentDatabase.Close
Set CurrentDatabase = Nothing
End If
DisplayContainers = True
End Function
<<<<<code ends>>>>>
Regards PR