Solved

Access2 Attached Tables Pathing on Network

Posted on 1997-11-05
2
234 Views
Last Modified: 2006-11-17
We are running an MS ACCESS 2 application where the data is stored in a separate database from the "front end".  The "front End" (Run Time version) is installed on each work station while the data mdb is to be installed on a LAN.  The tables from the data.mdb are attached to the front end mdb and are shared among multiple users.  Rather than installing the data.mdb by pathing it to a specific drive (ie H:\directory\data.mdb) we have been told to use the universal naming convention (UNC) to identify a specific location on the LAn (ie \\Server_name\location\directory\application) without identifying a specific drive letter.  Can this be done in Access 2.  If so, HOW do we do it?!!  Any assistance would be greatly appreciated!
0
Comment
Question by:director
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
innovate earned 100 total points
ID: 1958741
Hi director,

There are two ways of achieving this.

1) manually
2) Code (New attach or re-attach same or new location)

1)

First share your directory (resource) on the source machine (data)
In these examples the machine will be PC1 and share name Share1.

From the file menu select Attach Table.
Select Microsoft Access.
In the File name Dialogue box type the full UNC path to the Access database like

\\PC1\Share1\DbName.mdb

Then press OK.  IF you've got the path name right this will work fine and you can select the desired table.

In code

Use transfer database or the Connect property

TransferDatabase
Function attach ()
Dim strDatabase As String, strTable As String

strDatabase = "\\PC1\Share1\DbName.mdb"
strTable = "Mytable"

DoCmd TransferDatabase A_Attach, "Microsoft Access", strDatabase, A_TABLE, strTable, strTable

End Function

Re-attach an exisitng table using UNC's

Function reAttach ()
Dim db As Database, td As TableDef

Dim strDb As String, strTable As String

strDb = "\\PC1\Share1\DbName.mdb"
strTable = "Mytable"

Set db = CurrentDB()
Set td = db.Tabledefs(strTable)

td.Connect = ";Database=" & strDb & ";TABLE=" & strTable

Set td = Nothing
db.Tabledefs.Refresh
Set db = nothing

End Function

Enjoy
0
 

Author Comment

by:director
ID: 1958742
Thanks for your help!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question