Linked tables troubleshooting

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Emmett Power

    Linked tables troubleshooting

    Hi,

    I have a database with a number of linked tables. I want to remove two
    of them and can't. I can remove other linked tables in the database.

    Does anybody have any suggestions as to what I can do to get rid of
    the unwanted linked tables and make sure that the problem does not
    recur?

    Thanks in advance for any help.

    Regards

    Emmett Power
  • Mike MacSween

    #2
    Re: Linked tables troubleshooting

    What do you want to 'get rid of', the links or the tables themselves?

    What happens when you try to delete them? Any messages?

    "Emmett Power" <Emmett@Silic o-Research.com> wrote in message
    news:6e11de5c.0 404021116.30364 8ef@posting.goo gle.com...[color=blue]
    > Hi,
    >
    > I have a database with a number of linked tables. I want to remove two
    > of them and can't. I can remove other linked tables in the database.
    >
    > Does anybody have any suggestions as to what I can do to get rid of
    > the unwanted linked tables and make sure that the problem does not
    > recur?
    >
    > Thanks in advance for any help.
    >
    > Regards
    >
    > Emmett Power[/color]


    Comment

    • Emmett Power

      #3
      Re: Linked tables troubleshooting

      Hi Mike,

      Thanks for the help. I want to remove the linked table and the link in
      the master database. I want to keep the original tables in the other
      database intact.

      Nothing happens when I attempt to delete the table or open it: no error
      message - nada. I have tried refrshing - still nothing.

      The linked table seems to work fine in queries so I guess it's not
      corrupt.

      Thanks again.

      Emmett




      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • (Pete Cresswell)

        #4
        Re: Linked tables troubleshooting

        RE/[color=blue]
        >
        >Thanks for the help. I want to remove the linked table and the link in
        >the master database. I want to keep the original tables in the other
        >database intact.
        >
        >Nothing happens when I attempt to delete the table or open it: no error
        >message - nada. I have tried refrshing - still nothing.
        >
        >The linked table seems to work fine in queries so I guess it's not
        >corrupt.[/color]

        This is just off-the-cuff, but have you tried deleting it via DAO code instead
        of the UI? Last week, I found out that I could set .SubDataSheetNa me for a
        link via code, but that the UI would now allow it.
        --
        PeteCresswell

        Comment

        • Emmett Power

          #5
          Re: Linked tables troubleshooting

          Pete,

          Thanks for the suggestion: I'll try it. Do you have a sample of the code
          that worked for you?

          Regards

          Emmett Power



          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • (Pete Cresswell)

            #6
            Re: Linked tables troubleshooting

            RE/[color=blue]
            >Do you have a sample of the code
            >that worked for you?[/color]

            But remember - tjat was for .SubDataSheetNa me, not for the link....and
            it hits *all* of the tables.

            What you really want is to point to the TableDef in question and
            then issue a Delete.

            I did this in an Immediate window, and the link in question
            did, indeed, go away:
            --------------------------------------------------------------------
            CurrentDB.Table Defs.delete("zs tblAttachmentIn fo")
            --------------------------------------------------------------------
            Your milage may vary....



            For whatever reason... here's some.SubDataShe etName code
            ------------------------------------------------------------------
            Public Sub SubDataSheetZap ()

            Dim thisDB As DAO.Database
            Dim curTD As DAO.TableDef
            Dim newProp As DAO.Property
            Dim i As Long

            Const myNone = "[None]"
            Const newPropName = "SubDataSheetna me"

            Set thisDB = CurrentDb()

            SysCmd acSysCmdInitMet er, "Zapping SubDataSheet Names...",
            thisDB.TableDef s.Count
            For i = 0 To thisDB.TableDef s.Count - 1
            Set curTD = thisDB.TableDef s(i)
            If tablePropExist( newPropName, curTD) Then
            curTD.Propertie s(newPropName) = myNone
            Else
            Set newProp = curTD.CreatePro perty(newPropNa me, dbText, myNone)
            curTD.Propertie s.Append newProp
            Set newProp = Nothing
            End If
            SysCmd acSysCmdUpdateM eter, i
            Next i

            SysCmd acSysCmdRemoveM eter
            Set curTD = Nothing
            Set newProp = Nothing
            End Sub

            Private Function tablePropExist( ByVal thePropName As String, ByRef theTD As
            DAO.TableDef) As Boolean

            Dim myProp As DAO.Property

            On Error Resume Next
            Set myProp = theTD.Propertie s(thePropName)
            On Error GoTo 0

            If Not myProp Is Nothing Then
            tablePropExist = True
            End If
            End Function
            ------------------------------------------------------------------
            --
            PeteCresswell

            Comment

            Working...