Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

changing paths in access

Posted on 1997-08-24
3
Medium Priority
?
335 Views
Last Modified: 2012-06-27
I'm using access in office-95 and have setup a database. Now I'd like to ship it to a client, but the problem is their drive and path are different on the client side than when I created them. How can I change them from machine to machine ?
0
Comment
Question by:amirmansour
[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
3 Comments
 

Expert Comment

by:ronabb
ID: 1025236
Firstly, it's a good idea to try to get all of your systems installed into the same directory, so the problem does not arise.It's the disk letter that's usually the problem.  I set up a scheme whereby the program looks for a file called FILEOND.DAT and then deletes it's attached tables and reattaches them to the D drive in the "standard" directory. Same with FILEONE.DAT for the E: drive.
You can delete and reattach in code after determining that the info in the attach string is wrong.
Or you can do this with macros. use the DIR$ function to see if the file exists and use the length of the result (LEN(DIR$("FILEOND.DAT"))>0 to delete the attached tables and reattach them with the TransferDatabase action.
let me know if you need more.
0
 

Author Comment

by:amirmansour
ID: 1025237
It's not just the drive letter, it's the full path. The client could have installed it anywhere and to link to their tables, the path must be variable. To make matters even worse, they could have multiple data paths.
So I need to know how to change the the full path, not just the drive letter.

0
 
LVL 3

Accepted Solution

by:
chapie earned 150 total points
ID: 1025238
Eventhough a programmitic chaning of linked tables shouldn't be considered easy, here's the begginings of a solution you are seeking.  Gook luck.

Public Function ap_LocateBackend(dbLocal, dynSharedTables, strCurrError) As Boolean
Dim ocxDialog As Object

ap_LocateBackend = True

DoCmd.Echo True
Beep

If MsgBox("A problem has occurred accessing the linked tables." & _
     vbCrLf & vbCrLf & "The error was: " & strCurrError & vbCrLf & _
     vbCrLf & "Would you like to locate the backend?", vbCritical + _
     vbYesNo, "Error with Backend") = vbYes Then
   
   Set ocxDialog = Screen.ActiveForm!ocxDialogControl.Object
   
   With ocxDialog
      .FileName = gstrBackendName
      .InitDir = gstrAppPath
      .DialogTitle = "Please Locate " & gstrBackendName
      .Filter = gstrBackendName
      .CancelError = True
      .ShowOpen
   End With
   
   If Err.Number <> apErrComDlgCancel Then
      DoEvents
      ap_LinkTables dbLocal, dynSharedTables, ocxDialog.FileName
      gstrBackEndPath = Left$(ocxDialog.FileName, ap_LastInStr(ocxDialog.FileName, "\"))
   Else
      ap_LocateBackend = False
   End If
Else
   ap_LocateBackend = False
End If
   
Exit_ap_LocateBackend:
    Exit Function
Error_ap_LocateBackend:
    ap_LocateBackend = False
    Resume Exit_ap_LocateBackend
End Function
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 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