473,399 Members | 4,177 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,399 software developers and data experts.

Automate table re-linking

Hi,

How do I automate table re-linking? Presently I have to do this through link table manager. Thanks
Oct 29 '06 #1
8 7830
NeoPa
32,556 Expert Mod 16PB
Try :-
Expand|Select|Wrap|Line Numbers
  1. CurrentDb.TableDefs("tblMyTable").RefreshLink
or, for all of them :-
Expand|Select|Wrap|Line Numbers
  1. Dim tblTable as TableDef
  2. For Each tblTable In CurrentDb.TableDefs
  3.     If tblTable.Connection > "" Then Call tblTable.RefreshLink
  4. Next tblTable
Oct 29 '06 #2
Hi,

Where to put this code? To explain you further, I have a front end database and I want to link it with a back-end database which resides in other computer. Presently I can manage this manually through a link table manager where I can select the tables manually and browse for back-end location to refresh links for installation. Thanks
Oct 30 '06 #3
NeoPa
32,556 Expert Mod 16PB
Well that all depends on what you are trying to achieve.
If you can explain clearly what you want to do...
Oct 30 '06 #4
Hi,

1- I have created an ms access application named as CDM.mdb. It is my front application.
2- Through database splitter, I have created a back-end file (contain all tables) named as CDM_be.mdb which resides in my sharing drive.
3- I have distributed my front end to various users.
4- Sometimes it is required to distribute and re-install the application and I have to establish the links manually through a link table manager.
5- Users can not open my application database window / link table manager as I have disabled this option, also bypass key.
6- I want to automate this re-linking process through a code or some other option so that users could run the command to establish links without my support.

Thanks
Oct 30 '06 #5
Killer42
8,435 Expert 8TB
Hi,
1- I have created an ms access application named as CDM.mdb. It is my front application.
2- Through database splitter, I have created a back-end file (contain all tables) named as CDM_be.mdb which resides in my sharing drive.
3- I have distributed my front end to various users.
4- Sometimes it is required to distribute and re-install the application and I have to establish the links manually through a link table manager.
5- Users can not open my application database window / link table manager as I have disabled this option, also bypass key.
6- I want to automate this re-linking process through a code or some other option so that users could run the command to establish links without my support.

Thanks
Are you saying that the back-end database is in a different location each time you reinstall? Or do you just mean that you have to change the links to point to the real back-end instead of your development one, or what?

I worked with an Access database years ago which had an automated function (developed by someone else) which would change all the links to point to a selected location. Unfortunately it is in a password-protected archive file and I forgot the password years ago, so can't get it out.

If I manage to get it unzipped, I'll let you know.
Oct 30 '06 #6
Hi, back-end resides in my shared folder in local disk C.
I have distributed front-end to other users remotely who are connected with my network drive where back-end shared database folder resides. Now, whenever when I need to install the application, I have to open my front end database window and link table manager to select and browse for back-end database location manually to refresh the links. I want to automate this procedure if it is possible. Thanks
Oct 30 '06 #7
Killer42
8,435 Expert 8TB
Hi, back-end resides in my shared folder in local disk C.
I have distributed front-end to other users remotely who are connected with my network drive where back-end shared database folder resides. Now, whenever when I need to install the application, I have to open my front end database window and link table manager to select and browse for back-end database location manually to refresh the links. I want to automate this procedure if it is possible. Thanks
Why can't you just change the links in your front-end to point to the back-end tables via the network address, and work that way yourself? (Keeping backups in case of problems, of course). Surely that would mean you no longer need to cvhange it each time you distribute.
Oct 30 '06 #8
NeoPa
32,556 Expert Mod 16PB
Why can't you just change the links in your front-end to point to the back-end tables via the network address, and work that way yourself? (Keeping backups in case of problems, of course). Surely that would mean you no longer need to change it each time you distribute.
This is your best option.
Use a UNC link to your back end tables.
Assuming your PC is called 'ZeeshanPC' and the share you have defined for others to access via is called 'BackEnd' (with the database in the root of that share), then make a connection in Access to the back end database as \\ZeeshanPC\BackEnd\CDM_be.Mdb and connect to the tables from there.

If, for any reason this will not work then you can add some code to the OnOpen event of your first form (the one defined in StartUp options).
So, if you had a linked table called tblMain, then you can test if it works (using On Error Resume Next or whatever) and, if it doesn't, assume it's because it's accessing remotely and change the Connection property.
At this point I did some testing and found that, although it doesn't complain when you set the .Connect property, nor does it actually change it :(
So, unless someone else knows how set this, you'll have to go with the first option.

BTW - the .Connect property for a table (EG tblMain) would be CurrentDB.TableDefs!tblMain.Connect.
If it's blank then it's not a linked table.
Oct 30 '06 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: tjones8611 | last post by:
I have an application that updates a CSV file every 10 minutes. I am trying to use Access to append the information in the csv file to a table. The csv file does not append the new data, row 1 is...
4
by: Chris via AccessMonster.com | last post by:
I have the challenge of needing to automate table creation. It doesn't end there the tables have to be created from one table that looks something like this... Email ...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
0
by: deko | last post by:
I looking for way to reliably automate the process of upgrading users to a new version of an Access MDE application. I've tried this code a few times and it seems to work (gets custom menubars,...
25
by: MLH | last post by:
In an earlier post entitled... "A97 closes down each time I open a particular report" it has been suggested that I rebuild problematic table - one in which some corruption has occurred. I...
11
by: David Lozzi | last post by:
Hello, I need to automate importation of a excel file into a table. Here's my scenario: I'm writing an ASP.NET application where users can pull reports on imported data. The imported data is...
0
by: beary | last post by:
I am using php5 with mysql and also using excel 2003 running on winxp. Anyway, I am currently opening my excel.xls file, then saving as csv file, then closing, then copying it over to the web...
9
by: Ots | last post by:
I'm using SQL 2000, which is integrated with a VB.NET 2003 app. I have an Audit trigger that logs changes to tables. I want to apply this trigger to many different tables. It's the same trigger,...
5
by: NarayanaR | last post by:
Hello, I'm new to Office(!) but not to programming. I have a requirement that I'm struggling to solve: 1. In Access, I import a List from a sharepoint site as a linked table. 2. I delete all...
8
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a web site that automates excel. This site runs in server 2003. iis 6.0 office 2003 installed I moved this app to server 2008 iis 7.0 office 2003 installed Now when I try to automate...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.