472,778 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Updating Table Links on Install

I have an application which contains an Access database with linked
tables that point to another database within the application. The
problem I have is that when the user installs the application, I need
to update the table links so that the paths are correct for the install
directory. Is there an easy way to accomplish this?

I'd really like to avoid duplicating the data in the linked tables, but
if updating the links is too much work, I may just do that.

Dec 4 '06 #1
5 2005

<aa*************@gmail.comwrote in message
news:11**********************@80g2000cwy.googlegro ups.com...
>I have an application which contains an Access database with linked
tables that point to another database within the application. The
problem I have is that when the user installs the application, I need
to update the table links so that the paths are correct for the install
directory. Is there an easy way to accomplish this?

I'd really like to avoid duplicating the data in the linked tables, but
if updating the links is too much work, I may just do that.
The Developer Solutions sample database (see
http://support.microsoft.com/kb/248674/en-us in the Microsoft Knowledge Base
for information on the free download) has sample code for relinking tables
at startup.

Alternatively, the article at http://support.microsoft.com/kb/248674/en-us
tell you how to let the user use the Windows Common Dialog to choose a file
(the backend database) and you can create a TableDef with the link for each
table.

I use an approach very similar to the one in Developer Solutions that I
created prior to that sample database being available. It hasn't changed
much since the 16-bit Access 2.0 for which I initially created it.

Larry Linson
Microsoft Access MVP
Dec 4 '06 #2
Larry Linson wrote:
<aa*************@gmail.comwrote in message
news:11**********************@80g2000cwy.googlegro ups.com...
I have an application which contains an Access database with linked
tables that point to another database within the application. The
problem I have is that when the user installs the application, I need
to update the table links so that the paths are correct for the install
directory. Is there an easy way to accomplish this?

I'd really like to avoid duplicating the data in the linked tables, but
if updating the links is too much work, I may just do that.

The Developer Solutions sample database (see
http://support.microsoft.com/kb/248674/en-us in the Microsoft Knowledge Base
for information on the free download) has sample code for relinking tables
at startup.

Alternatively, the article at http://support.microsoft.com/kb/248674/en-us
tell you how to let the user use the Windows Common Dialog to choose a file
(the backend database) and you can create a TableDef with the link for each
table.

I use an approach very similar to the one in Developer Solutions that I
created prior to that sample database being available. It hasn't changed
much since the 16-bit Access 2.0 for which I initially created it.

Larry Linson
Microsoft Access MVP
Thanks for the link. One question: will the automatic relinking
trigger when a database connection is made through ADO, or only if the
database is opened in Access?

Dec 4 '06 #3
Table linking, as addressed in the sample database, is a matter of
definition of the tables, that is, the TableDefs Collection, in an MDB. The
code illustrated is VBA and DAO code. I can't imagine a good reason to use
ADO with a Jet database, because DAO is the native language of Jet. And, as
for me, I prefer to use DAO and link tables via ODBC even with server
databases.

The only advantage (if any) that I can see to using ADO, is using it with
another database, and without linking, via OLEDB (also called "an ADO data
provider"), so I just don't understand your follow-up question.

Someone else would have to discuss whether linked Tables makes any sense in
an ADO environment -- I certainly can't, as the only times I have used ADO
were some early practice testing and on projects done with an Access ADP
(aks "Access Project") that used ADO via OLEDB to access Microsoft SQL
Server directly. (And, as I have said before, I was unable to determine any
improvement in performance, and certainly none in ease of development with
the ADP - ADO - OLEDB - MS SQL Server environment. I'd work on such a DB
again if a customer alreeady had one and insisted, but I'd refer them to
another develper if they insisted on creating a new database in that
environment.

Larry Linson
Microsoft Access MVP
<aa*************@gmail.comwrote in message
news:11*********************@f1g2000cwa.googlegrou ps.com...
Larry Linson wrote:
><aa*************@gmail.comwrote in message
news:11**********************@80g2000cwy.googlegr oups.com...
>I have an application which contains an Access database with linked
tables that point to another database within the application. The
problem I have is that when the user installs the application, I need
to update the table links so that the paths are correct for the install
directory. Is there an easy way to accomplish this?

I'd really like to avoid duplicating the data in the linked tables, but
if updating the links is too much work, I may just do that.

The Developer Solutions sample database (see
http://support.microsoft.com/kb/248674/en-us in the Microsoft Knowledge
Base
for information on the free download) has sample code for relinking
tables
at startup.

Alternatively, the article at
http://support.microsoft.com/kb/248674/en-us
tell you how to let the user use the Windows Common Dialog to choose a
file
(the backend database) and you can create a TableDef with the link for
each
table.

I use an approach very similar to the one in Developer Solutions that I
created prior to that sample database being available. It hasn't changed
much since the 16-bit Access 2.0 for which I initially created it.

Larry Linson
Microsoft Access MVP

Thanks for the link. One question: will the automatic relinking
trigger when a database connection is made through ADO, or only if the
database is opened in Access?

Dec 5 '06 #4
I probably should have noted up front that this isn't a native Access
app. I used ADO because when I started adding DAO components to my
VC++ application I got lovely deprecation warnings.

I'll probably just import the tables and deal with having two copies.
It's a pretty small amount of data so there's really no major issues
with that for now. It's just not elegant. But then, we write
applications with the databases we have, not the databases we might
want. ;)

Larry Linson wrote:
Table linking, as addressed in the sample database, is a matter of
definition of the tables, that is, the TableDefs Collection, in an MDB. The
code illustrated is VBA and DAO code. I can't imagine a good reason to use
ADO with a Jet database, because DAO is the native language of Jet. And, as
for me, I prefer to use DAO and link tables via ODBC even with server
databases.

The only advantage (if any) that I can see to using ADO, is using it with
another database, and without linking, via OLEDB (also called "an ADO data
provider"), so I just don't understand your follow-up question.

Someone else would have to discuss whether linked Tables makes any sense in
an ADO environment -- I certainly can't, as the only times I have used ADO
were some early practice testing and on projects done with an Access ADP
(aks "Access Project") that used ADO via OLEDB to access Microsoft SQL
Server directly. (And, as I have said before, I was unable to determine any
improvement in performance, and certainly none in ease of development with
the ADP - ADO - OLEDB - MS SQL Server environment. I'd work on such a DB
again if a customer alreeady had one and insisted, but I'd refer them to
another develper if they insisted on creating a new database in that
environment.

Larry Linson
Microsoft Access MVP
<aa*************@gmail.comwrote in message
news:11*********************@f1g2000cwa.googlegrou ps.com...
Larry Linson wrote:
<aa*************@gmail.comwrote in message
news:11**********************@80g2000cwy.googlegro ups.com...
I have an application which contains an Access database with linked
tables that point to another database within the application. The
problem I have is that when the user installs the application, I need
to update the table links so that the paths are correct for the install
directory. Is there an easy way to accomplish this?

I'd really like to avoid duplicating the data in the linked tables, but
if updating the links is too much work, I may just do that.

The Developer Solutions sample database (see
http://support.microsoft.com/kb/248674/en-us in the Microsoft Knowledge
Base
for information on the free download) has sample code for relinking
tables
at startup.

Alternatively, the article at
http://support.microsoft.com/kb/248674/en-us
tell you how to let the user use the Windows Common Dialog to choose a
file
(the backend database) and you can create a TableDef with the link for
each
table.

I use an approach very similar to the one in Developer Solutions that I
created prior to that sample database being available. It hasn't changed
much since the 16-bit Access 2.0 for which I initially created it.

Larry Linson
Microsoft Access MVP
Thanks for the link. One question: will the automatic relinking
trigger when a database connection is made through ADO, or only if the
database is opened in Access?
Dec 5 '06 #5
aa*************@gmail.com wrote in
news:11**********************@l12g2000cwl.googlegr oups.com:
I probably should have noted up front that this isn't a native
Access app.
Ya think?

The question doesn't even belong in this newsgroup, as you're not
using Access at all -- you're just using Jet.

And all answers regarding "linked tables" are, by definition,
Access-specific answers, and won't help you at all if you're not
actually using Access.

I really wish Microsoft would not use "Access database" and "Jet
database" interchangably.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 5 '06 #6

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

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
3
by: Jim Cobban | last post by:
I have a set of web pages that are organized in pairs. One of each pair contains a graphic and the other is an extended description of the graphic. I am trying to set it up that selecting a single...
2
by: RC | last post by:
I am updating/improving a working database for a non-profit organization. I am thinking of making a copy of the database at the office, bringing the copy to my house, making the changes and then...
1
by: Darryl Neale | last post by:
I have been tasked with reviving an old database that stopped working about 3 years ago :( On one of the tabs is a list of links to other databases utilising the Hyperlink feature of MS Access...
3
by: Doug | last post by:
Scenario: I select data from a SQL Server View which links 3 tables, into a single dataset table. I update some of those fields on a web form. When I want to update the db, clearly I can't update...
4
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has...
4
by: somanyusernamesaretakenal | last post by:
What I am trying to achieve: Basically I have generated a report in access. This report needs to be updated using excel. (Updating the new data, not changing existing data) What I did was I...
2
by: UKuser | last post by:
Hi Folks, I havent used javascript in ages, and am not the worlds guru, but I'm playing with ajax linking to my database and an updating area. I have an area named display for example which...
2
by: Conrad Lender | last post by:
On 2008-10-10 19:56, T.G. wrote: This doesn't work at all, at least not in Firefox. When any of the "up" or "down" links is clicked, the following error occurs: clickedRow.removeNode is not a...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.