[AccessD] mdb speed

Kath Pelletti SDSSoftware at optusnet.com.au
Mon Oct 20 07:55:45 CDT 2003


I deleted the message from marcel(?) too fast - but Marcel here is some code previously posted to the list to turn off all subdatasheets in your tables, ie. to set the name of the subdatasheet name to "None".
(Sorry - can't credit original author...)

Marcel - there have been some really good posts to the list on speed and performance issues - maybe a search for 'speed' in the archives would be of some help to you?

Kath

Function TurnOffSubDataSheets()
  Dim MyDB As DAO.Database
  Dim MyProperty As DAO.Property
  
  Dim propName As String
  Dim PropType As Integer
  Dim propVal As String
  
  Dim strS As String
  
  Set MyDB = CurrentDb
  
  propName = "SubDataSheetName"
  PropType = 10
  propVal = "[NONE]"
  
  On Error Resume Next
  
  For I = 0 To MyDB.TableDefs.Count - 1
      
      If (MyDB.TableDefs(I).Attributes And dbSystemObject) = 0 Then

          If MyDB.TableDefs(I).Properties(propName).Value <> propVal Then
             MyDB.TableDefs(I).Properties(propName).Value = propVal
             intChangedTables = intChangedTables + 1
          End If
 
          If Err.Number = 3270 Then
             Set MyProperty = MyDB.TableDefs(I).CreateProperty(propName)
             MyProperty.Type = PropType
             MyProperty.Value = propVal
             MyDB.TableDefs(I).Properties.Append MyProperty
          Else
             If Err.Number <> 0 Then
                 MsgBox "Error: " & Err.Number & " on Table " _
                 & MyDB.TableDefs(I).Name & "."
                 MyDB.Close
                 Exit Function
             End If
          End If
          
      End If
  Next I

MsgBox "The " & propName & _
" value for all non-system tables has been updated to " & propVal & "."

MyDB.Close

End Function




Kath Pelletti
Software Design & Solutions Pty Ltd.
Ph: 9505-6714
Fax: 9505-6430
sdssoftware at optusnet.com.au


More information about the AccessD mailing list