PC Review


Reply
Thread Tools Rate Thread

check if a table is linked

 
 
Luis
Guest
Posts: n/a
 
      20th Feb 2009
Hello.
I'm trying to export all tables of a database to a new database. This task
needs to run everyday.
The issue here is that i don't want to export linked tables.

How can i check if a table is linked or not?

Thanks,

Luis
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      20th Feb 2009
You can check whether its Connect property is set.

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

Set dbCurr = CurrentDb()
For Each tdfCurr In dbCurr.TableDefs
If Len(tdfCurr.Connect) > 0 Then
Debug.Print "Table " & tdfCurr.Name & " is linked."
Else
Debug.Print "Table " & tdfCurr.Name & " is not linked."
End If
Next tdfCurr

Another way would be to look it up in the MSysObjects table:

Function IsLinked(TableName As String) As Boolean

IsLinked = Nz(DLookup("Type", "MSysObjects", _
"Name = '" & TableName & "'"), 0) <> 1

End Function

(Non-linked tables have a type of 1, tables linked using ODBC have a type of
4 and all other linked tables have a type of 6)

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


"Luis" <(E-Mail Removed)> wrote in message
news:00DDA716-4211-4195-8A33-(E-Mail Removed)...
> Hello.
> I'm trying to export all tables of a database to a new database. This task
> needs to run everyday.
> The issue here is that i don't want to export linked tables.
>
> How can i check if a table is linked or not?
>
> Thanks,
>
> Luis



 
Reply With Quote
 
dymondjack
Guest
Posts: n/a
 
      20th Feb 2009
http://www.mvps.org/access/tables/tbl0009.htm

This relinks tables for you, somewhere in there it checks to see if it's a
linked table. If you want to sift through it to find that code feel free...
the answers in there.

Or you can wait for a more direct answer

hth


--
Jack Leach
www.tristatemachine.com

- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain


"Luis" wrote:

> Hello.
> I'm trying to export all tables of a database to a new database. This task
> needs to run everyday.
> The issue here is that i don't want to export linked tables.
>
> How can i check if a table is linked or not?
>
> Thanks,
>
> Luis

 
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
Check if a linked table in the database has been updated/changed CliffKing Microsoft Access VBA Modules 1 1st Dec 2007 06:18 PM
linked table not updating ..what to check ? Steve Microsoft Access Database Table Design 4 7th Feb 2007 11:15 AM
Check all fields in linked table are completed =?Utf-8?B?TWFja2F5IDE5Nzk=?= Microsoft Access Queries 0 27th May 2005 07:22 AM
Check linked table connection July Microsoft Access VBA Modules 1 28th Jul 2004 05:01 PM
check for Linked Table Manager Install? BRAD Microsoft Access VBA Modules 1 31st Dec 2003 07:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:32 AM.