There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot browser bsod computer crash css dell desktop driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware help please hijackthis hjt hjt log install internet internet explorer itunes javascript keyboard laptop log malware monitor network networking openoffice outlook outlook 2003 outlook express password popups problem router seo slow sound sp3 spyware startup trojan usb video virtumonde virus vista vundo windows windows xp winxp wireless youtube
Business Applications
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Business Applications >
Updating a linked table


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
MavDog's Avatar
Junior Member with 26 posts.
 
Join Date: Apr 2008
Experience: Intermediate
12-May-2008, 11:13 AM #1
Updating a linked table
I have a Access database that can be copied into multiple directories. I have a table in this database that is linked to a file that is in the same directory. Is there a way to generically name the file so it will always look for it in the local directory? Is there a way to have Access prompt you for the location and filename when you open it up? I tried to do this manually with the Linked Table Manager but I get an error becasue the filename that I am selecting is a different name. Thanks
MavDog's Avatar
Junior Member with 26 posts.
 
Join Date: Apr 2008
Experience: Intermediate
13-May-2008, 03:32 PM #2
Does anyone have any ideas? Thanks
Chris_E's Avatar
Senior Member with 284 posts.
 
Join Date: Feb 2006
Location: Wellingborough, UK
Experience: I have no idea what I don't know - how could I?
13-May-2008, 06:07 PM #3
Hi MavDog

I'm a bit confused by yur requirement.... maybe you could describe it a little more clearly?

In particular "I have a table in this database that is linked to a file that is in the same directory"

So if a database called ABC.MDB file resides in (example) C:\ there is a table in ABC.MDB that is linked to a table in a second database called ZXY.MDB in C:\

But if you have a copy in D:\ABC.MDB, you need to be able to relink the table to the D:\ZXY.MDB file

Is that it?

If so, follow this link to http://www.mvps.org/access/tables/tbl0009.htm it may start you in the right direction.

Its a VBA thing!

Chris
MavDog's Avatar
Junior Member with 26 posts.
 
Join Date: Apr 2008
Experience: Intermediate
14-May-2008, 11:14 AM #4
Sorry my email was not clear. Hopefully this will clear it up.

I have a program called MyProgram.mdb currently this is located in C:\Dir1. Inside of this program I have a linked table to a text file called Dir1File.txt. This all works fine.

Now I want to copy the MyProgram.mdb to a different directory called C:\Dir2. I now need to update the linked table to use Dir2File.txt instead.

I am looking for a way that this link can be updated.

One way would be to update it when you open MyProgram.mdb

The other way would be to rename the text file to File.txt instead and this would be the same name in all the directoruies. In this case the link would just need to look in the same directory as where the MyProgram.mdb is. I have looked at the linked tables and it seems like they always have a full path associated with them and this is what is causing the problems. I just want it to look in the local directory.

Thanks
Chris_E's Avatar
Senior Member with 284 posts.
 
Join Date: Feb 2006
Location: Wellingborough, UK
Experience: I have no idea what I don't know - how could I?
14-May-2008, 11:21 AM #5
I've never come across use of linked tables to text files.

You say

Quote:
I have a program called MyProgram.mdb currently this is located in C:\Dir1. Inside of this program I have a linked table to a text file called Dir1File.txt. This all works fine.
By this I can only assume that you have a field in your table that provides a link (HyperLink) to a .TXT file in a directory?

Before proceding more, is that the case or are you REALLY linking a table to a TXT file?

Can you put some dummy data in a copy of the MDB, ZIP it and post it? Then we can all have a look for you!

Cheers

Chris
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,062 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
14-May-2008, 11:26 AM #6
MavDog, why are you linking to the table rather than importing in to the database?
MavDog's Avatar
Junior Member with 26 posts.
 
Join Date: Apr 2008
Experience: Intermediate
14-May-2008, 11:29 AM #7
Hi Chris,

Yes I am really linking to a .txt file.

I have attached the MDB. The DX_BOM table is the one that needs to be updated. Right now it is pointing to C:\HWE\Projects\A0213-2007\Schematics\A0213-2007_BOM_MAX.txt when I copy the MDB to a different directory I would want to link to C:\HWE\Projects\A0123-2007\Schematics\A0123-2007_BOM_MAX.txt instead.

Does that make sense?
Attached Files
File Type: zip Example.zip (99.5 KB, 3 views)
MavDog's Avatar
Junior Member with 26 posts.
 
Join Date: Apr 2008
Experience: Intermediate
14-May-2008, 11:33 AM #8
Because the data in this table could be changing I figured a linked table made more since then doing an import every time I wanted to do a compare with the table.
MavDog's Avatar
Junior Member with 26 posts.
 
Join Date: Apr 2008
Experience: Intermediate
15-May-2008, 10:25 AM #9
Hi Chris,

Is what I am looking for clear now or do I need to explain it further? Thanks
Chris_E's Avatar
Senior Member with 284 posts.
 
Join Date: Feb 2006
Location: Wellingborough, UK
Experience: I have no idea what I don't know - how could I?
15-May-2008, 10:52 AM #10
Sort of but can you send a copy of the C:\HWE\Projects\A0213-2007\Schematics\A0213-2007_BOM_MAX.txt
as an example.

You say that you are linking to a txt file because the data in this table could be changing".

How will it change?

I think the ultimate question is "why can or would the DB be moved or copied into different folders?

Why not create a folder in "My Documents" and always reference that folder, regardless of where the MDB is located?

Chris
MavDog's Avatar
Junior Member with 26 posts.
 
Join Date: Apr 2008
Experience: Intermediate
15-May-2008, 01:51 PM #11
Hi Chris,

I have attached the txt file.

The text file is a Bill of Materials that is generated from a schematic program. As changes are made to the schematic the BOM gets updated.

The reason that it will be moved is because multiple people will be using it. Each person is working on a different project and that is the reason the A# will be changing. Also people can be working on more than one project at a time and this is another reason they would have multiple copies. One copy in each project directory. I understand that I could limit it to one directory that it would run out of and copy and rename the text file into that directory but that opens up the posibilty that the latest data would not be in there. I am trying ot make this as generic as possible so that it will be foolproof and useful.

Hopefully my explanation is making sense.

Thanks -Kevin
Attached Files
File Type: txt A0213-2007_BOM_MAX.txt (951 Bytes, 7 views)
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,062 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
15-May-2008, 03:14 PM #12
This is very bad database usage, having multiple copies of the database is not a good idea, the whole point of Access databases is to make the same data available to everybody, not everybody have their own copy.
You could have a completely automated Import of the BOM file when the database is opened or at the same time every day.
__________________
.
.
OBP
I do not give up easily
MavDog's Avatar
Junior Member with 26 posts.
 
Join Date: Apr 2008
Experience: Intermediate
15-May-2008, 03:25 PM #13
I am using Access mainly so that I can link to a ODBC and then do a compare. This is really not a database app in which the generated tables are used for anything else.

Everyone will have access to the same shared database that I am comparing to. Since each person has their own project they are working on there is no database to share for the txt file since they are unique.

An import would possible work but I would still need a way forit to ask the user for the location of their txt file to import. I would need to update the imported data each time I do the compare though to make sure it is the latest data. Wouldn't this be the same whether it is an import or linking ot a table? If not I am glad to go the import way if that is easier.

Maybe I am not explaining my application very good becasue I don't see any issues with what I am trying to implement. As I mentioned I know that my app is not the average way a database is used but it seemed like the best program for what I was trying to do. So if you don't think that Access is the right program for this then what would you suggest? Thanks -Kevin
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,062 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
15-May-2008, 03:32 PM #14
Kevin, can't the Database and text fiel be stored on a server?
That is the normal way to locate a file so that evryone can use it.
Or does everyone have a different version of the txt file?
MavDog's Avatar
Junior Member with 26 posts.
 
Join Date: Apr 2008
Experience: Intermediate
15-May-2008, 03:45 PM #15
Yes everyone has a different version of the text file. Think of is as one person designing a DVD player and another person designing a TV. Both people with have totally different text files for the parts used on their design. This is the unique part. The unique text files are however compared against a shared database.

Here is a little more of an explanation. One database is the text file that is generated by a schematic program. This data is then entered into a manufacturing software system.

At some point later in time, for example when we need to make a change to the DVD design I want to run this compare utility to verify that the BOM items in the manufacturing software and the schematic are the same before we make any changes. Maybe a resistor value was changed in the manufacturing software but was not changed in teh schematic. This compare that I have written will point that difference out.

Is this a better explanation or am I making it more confusing?
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:40 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.