Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / April 2005

Tip: Looking for answers? Try searching our database.

Setting Subdatasheet name to none

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roy Goldhammer - 15 Apr 2005 11:23 GMT
Hello there

I have huge database on access 2003 with 400 tables on it (most of them are
linked to sql server)

When i convert it from access 97 the subdatasheet name property become Auto

To improve performance i need to set the subdatasheet name to none.

Is there a way to do this on code?
John Vinson - 15 Apr 2005 18:22 GMT
>Hello there
>
[quoted text clipped - 6 lines]
>
>Is there a way to do this on code?

Yes. I apologize to whoever I got this code from - you didn't identify
yourself in it and I've forgotten which website it was on, but it
works VERY well and I've used it routinely.

Public Function TurnOffSubDataSh() As Integer
   Dim db As DAO.Database
   Dim tdf As DAO.TableDef
   Dim prp As DAO.Property
   Const conPropName = "SubdatasheetName"
   Const conPropValue = "[None]"
   
   TurnOffSubDataSh = 0
   Set db = DBEngine(0)(0)
   For Each tdf In db.TableDefs
       If (tdf.Attributes And dbSystemObject) = 0 Then
           If tdf.Connect = vbNullString And Asc(tdf.Name) <> 126 _
   Then 'Not attached, or temp.
               If Not HasProperty(tdf, conPropName) Then
                   Set prp = _
   tdf.CreateProperty(conPropName, dbText, conPropValue)
                   tdf.Properties.Append prp
                   TurnOffSubDataSh = TurnOffSubDataSh + 1
               Else
                  If tdf.Properties(conPropName) <> conPropValue Then
                       tdf.Properties(conPropName) = conPropValue
                       TurnOffSubDataSh = TurnOffSubDataSh + 1
                  End If
               End If
           End If
       End If
   Next

   Set prp = Nothing
   Set tdf = Nothing
   Set db = Nothing
End Function

                 John W. Vinson[MVP]    
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.