[AccessD] mdb speed

Charlotte Foust cfoust at infostatsystems.com
Mon Oct 20 11:01:36 CDT 2003


John,

You just need to run it on the database it applies to.  You could open
the back end in code and run the routine against its tables without
actually putting the code into the BE.

Charlotte Foust

-----Original Message-----
From: John Colby [mailto:jcolby at colbyconsulting.com] 
Sent: Monday, October 20, 2003 7:44 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] mdb speed


I assume this has to be inserted into a module in the BE and run with
the BE open?

John W. Colby
www.colbyconsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Kath Pelletti
Sent: Monday, October 20, 2003 8:56 AM
To: AccessD at databaseadvisors.com
Subject: [AccessD] mdb speed


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
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list