By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,183 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Linked tables troubleshooting

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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" <Em****@Silico-Research.com> wrote in message
news:6e**************************@posting.google.c om...
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

Nov 12 '05 #2

P: n/a
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!
Nov 12 '05 #3

P: n/a
RE/

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.


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 .SubDataSheetName for a
link via code, but that the UI would now allow it.
--
PeteCresswell
Nov 12 '05 #4

P: n/a
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!
Nov 12 '05 #5

P: n/a
RE/
Do you have a sample of the code
that worked for you?


But remember - tjat was for .SubDataSheetName, 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.TableDefs.delete("zstblAttachmentInfo")
--------------------------------------------------------------------
Your milage may vary....

For whatever reason... here's some.SubDataSheetName 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 = "SubDataSheetname"

Set thisDB = CurrentDb()

SysCmd acSysCmdInitMeter, "Zapping SubDataSheet Names...",
thisDB.TableDefs.Count
For i = 0 To thisDB.TableDefs.Count - 1
Set curTD = thisDB.TableDefs(i)
If tablePropExist(newPropName, curTD) Then
curTD.Properties(newPropName) = myNone
Else
Set newProp = curTD.CreateProperty(newPropName, dbText, myNone)
curTD.Properties.Append newProp
Set newProp = Nothing
End If
SysCmd acSysCmdUpdateMeter, i
Next i

SysCmd acSysCmdRemoveMeter
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.Properties(thePropName)
On Error GoTo 0

If Not myProp Is Nothing Then
tablePropExist = True
End If
End Function
------------------------------------------------------------------
--
PeteCresswell
Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.