PC Review


Reply
Thread Tools Rate Thread

Deleting linked tables

 
 
Tim
Guest
Posts: n/a
 
      29th Jun 2004
My database is used by remote workers who work on a stand-
alone basis but I have written code to create links to
tables in a central database when they need to access that
data. I need to write code to sever those links when the
users wish to work on a stand-alone basis again. Is there
a way I can write code to delete all linked tables, or do
I have to name them individually?
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      29th Jun 2004
You have to name them individually, but you can always loop through the
TableDefs collection and do it that way. Assuming you've got a reference set
to DAO, the following untested air-code will delete all linked tables in
your database:

Dim dbCurr As DAO.Database
Dim tdfCurr As DAO.TableDef
Dim lngLoop As Long

Set dbCurr = CurrentDb()
For lngLoop = (dbCurr.TableDefs.Count - 1) To 0 Step -1
Set tdfCurr = dbCurr.TableDefs(lngLoop)
If Len(tdfCurr.Connect) > 0 then
dbCurr.TableDefs.Delete tdfCurr.Name
End If
Next lngLoop

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)


"Tim" <(E-Mail Removed)> wrote in message
news:22a8701c45dd7$cb9751a0$(E-Mail Removed)...
> My database is used by remote workers who work on a stand-
> alone basis but I have written code to create links to
> tables in a central database when they need to access that
> data. I need to write code to sever those links when the
> users wish to work on a stand-alone basis again. Is there
> a way I can write code to delete all linked tables, or do
> I have to name them individually?



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Not Working For Deleting All Linked Tables Gary S Microsoft Access VBA Modules 3 12th Jul 2008 03:30 AM
Deleting Sharepoint Linked Tables PatK Microsoft Access External Data 14 27th Feb 2008 02:35 PM
Record deleting in Linked Tables =?Utf-8?B?cm9hZHNpZ243MQ==?= Microsoft Access 7 8th Feb 2006 06:36 PM
Deleting Linked Tables Programmatically =?Utf-8?B?V0laQVJE?= Microsoft Access External Data 0 11th Dec 2004 02:05 PM
Deleting Linked tables programmatically J Microsoft Access External Data 1 29th Jun 2004 10:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:14 AM.