473,385 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Relink all tables in other database

Jim
I have a database with a front and back end setup as follows:

Front:
\\nt\database\NewDB\Stats.mdb = forms, reports, queries

Back:
"\\nt\database\NewDB\StatsData.mdb" = tables

When the front is opened, I want to check and see if all the tables
that are in the back end are currently linked to the front end... is
there a way to do this without hard-keying all the names of the tables?

Thanks for helping.

Nov 13 '05 #1
3 2138
On 7 Jun 2005 06:14:32 -0700, "Jim" <jl*******@gmail.com> wrote:

Yes. You can loop over the TableDefs collection, checking the
Attributes property for dbAttachedTable.

-Tom.

I have a database with a front and back end setup as follows:

Front:
\\nt\database\NewDB\Stats.mdb = forms, reports, queries

Back:
"\\nt\database\NewDB\StatsData.mdb" = tables

When the front is opened, I want to check and see if all the tables
that are in the back end are currently linked to the front end... is
there a way to do this without hard-keying all the names of the tables?

Thanks for helping.


Nov 13 '05 #2
Jim
I'm not that much of a guru... can you point me to where I can find
more information on how to do what you suggest above?

Nov 13 '05 #3

Create a new module, name it "basCheckIfReLinkNeeded", and place the
code below in it. Then you can call the function from your AutoExec
macro, or in the Startup Form.

Public Function CheckIfRelinkRequired2()
Dim lngUnLinkedTables As Long
lngUnLinkedTables = _
DCount("Database", _
"MSysObjects", _
"[Type]=6 AND " & _
"Dir$([Database])=''")
If lngUnLinkedTables > 0 Then
MsgBox lngUnLinkedTables & " Tables Cannot Be Found" &
vbNewLine & _
"You Must Relink The External DataBases!", _
vbCritical + vbOKOnly, _
"Relink Required"
End If
End Function

You may need A2K or above for this to work. I haven't tried in in
Access 97 or below... (Yeah, laziness....)
Jim wrote:
I have a database with a front and back end setup as follows:

Front:
\\nt\database\NewDB\Stats.mdb = forms, reports, queries

Back:
"\\nt\database\NewDB\StatsData.mdb" = tables

When the front is opened, I want to check and see if all the tables
that are in the back end are currently linked to the front end... is
there a way to do this without hard-keying all the names of the tables?

Thanks for helping.


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
2
by: PeteCresswell | last post by:
My code for DoCmd.TransferDatabase stopped working after applying the update in question. Seems like the last argument (optional: SaveLogInID) can no longer be specified when...
1
by: sparks | last post by:
At first I thought I could just delete the tables and import the tables. BUT my tables have relationships and I can not delete a table with relations. So that only deleted the non relational tables...
11
by: DraguVaso | last post by:
Hi, I want to make a small application in VB.NET that relinks all the query's and tables in an Access database that are linked via ODBC to an SQL Server. It must be able to relink all the tables...
0
by: DraguVaso | last post by:
Hi, I need to relink a whole bunch of Access-Linked-Tables and Pass-Through-Query's to another ODBC with VB.NET I foudn alreaddy how to relink the Tables, and I thought the query's woudl be...
4
by: Oceania | last post by:
Hi All, I did try using the sample code from the ADO.net forum to link one table, it is working fine. But, I got a problem when I tried to link all tables (20 tables)... Please help, thank...
12
by: lesperancer | last post by:
I've got two MDBs, that due to size, security, etc, need to be kept separate quotation configurator (there will be more of these in the future) so within quotation.mdb, I linked all the...
2
by: cranfan | last post by:
I'm using a relink method.It works fine but i have a question about making it work fast. If .Tables(tdfRelink.name).Type = "LINK" Then in this line i put a breakpoint and look for the table...
1
by: Coni | last post by:
Hello, I am following steps to implement security on access 2003 through distribution: I have split the database and I am trying to distribute it: I have copied the back end file and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.