Re: Can I set relative paths for linked tables instead of absolute path?
- From: Tim Ferguson <FergusonTG@xxxxxxxxxxxx>
- Date: Tue, 22 Nov 2005 11:03:23 -0800
Hyko <none@xxxxxxxxxxxxxxxxx> wrote in
news:BFA90D5C.7C8E%none@xxxxxxxxxxxxxxxxx:
> If I link a table to my Access DB from another Access DB the absolute
> path to this DB is used. When I upload the database to the server,
> where I use the databases as data source for a web application it
> cannot find this path of course.
>
As long as the (front end) mdb knows, or can find out, the site of the
back end file, you can write a short subroutine that will update the
..connect property of the relevant tabledefs:
strConnect = ";DATABASE=" & strPathToMDBFile
For p = 0 To db.TableDefs.Count - 1
Set tdf = db.TableDefs(p)
If tdf.Attributes And DB_ATTACHEDTABLE Then
If tdf.Connect <> strConnect Then
tdf.Connect = strConnect
tdf.RefreshLink
End If
End If
Next p
Note that this is uses the DAO library: it's probably possible using ADOX
but I can't imagine why anyone would want to...
All the best
Tim F
.
- Follow-Ups:
- Re: Can I set relative paths for linked tables instead of absolute path?
- From: Amy Blankenship
- Re: Can I set relative paths for linked tables instead of absolute path?
- References:
- Prev by Date: Re: Multiple Tables
- Next by Date: Re: When "Splitting" isn't enough
- Previous by thread: Re: Can I set relative paths for linked tables instead of absolute path?
- Next by thread: Re: Can I set relative paths for linked tables instead of absolute path?
- Index(es):
Relevant Pages
|