Sửa lỗi file mdb is not a valid path năm 2024

A few weeks ago, out of nowhere, I started receiving the following error when I started Excel after a restart or resuming from a locked computer.

Show
Run-time error ‘-2147467259 (80004005) [Microsoft][ODBC Microsoft Access Driver] ‘(unknown)’ is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

I have a ton of add-ins that load at startup and more than a few of them connect to an Access database via ActiveX Data Objects (ADO). The offending code was simply establishing the ADO connection.

Sub ConnectToMRP()

If gcnMRP Is Nothing Then

Set gcnMRP \= New ADODB.Connection

gcnMRP.Open gsMRPConn

End If

End Sub

The global constant, gsMRPConn, pointed to the file correctly. I was able to access the network share via Windows Explorer. But when I executed the code

I got 0, meaning VBA couldn’t resolve the path. The fix for a while was to close Excel and restart. Sometimes one restart would fix it and other times it took up to five restarts. I was at a loss for why VBA couldn’t see the network share.

After much searching, I read something about offline files. I had no idea what offline files were or why I would want them. Apparently Windows makes a cache of network files locally so that I can access them when I’m not on the network. I typed “offline files” in the Win7 start menu and found the Offline Files dialog.

I disabled offline files and have not had the problem since. I still don’t know how offline files work. I was connected to the network, so there was no need for Windows to use files offline. And if it had a cache, I’m not sure why it didn’t use it. I guess Windows was working to sync offline files in the background, which is why it worked after some number or restarts. I’m just glad the nightmare is over.

I suspect you are using 64-bit EG. EG uses the Microsoft Jet Engine provider to write to the .mdb format. The Microsoft Jet Engine is 32-bit only, thus only works in 32-bit EG, thus exporting to .mdb (via the client UI) is only available in 32-bit EG.

EG's system requirements doc has this note:

"Note: On 64-bit operating systems, SAS recommends using the 32-bit version of SAS Enterprise Guide for greater compatibility with data providers. See reference, SAS Deployment Wizard and SAS Deployment Manager 9.4 User's Guide.pdf for more information."

Related, but applies to import rather than export... in the EG help (Help->SAS Enterprise Guide Help), the "Working with Data: File types that SAS Enterprise Guide reads and writes" topic has this note:

"In the 64-bit version of SAS Enterprise Guide, you can import Microsoft Access files (*.mdb, *.accdb) only if the 64-bit version of Microsoft Access or the 64-bit version of the Microsoft Office System (ACE) Driver is installed. Similarly, if you are running the 32-bit version of SAS Enterprise Guide, then you must have the 32-bit version of Microsoft Access or the Microsoft Office System (ACE) Driver in order to import Microsoft Access files."

Note: The comments above apply to the client, when the client is performing the import or export (rather than SAS code on the server). The server (ex. processing proc import and proc export) has different, but similar requirements. See proc import/export doc for those.

Error: \GentranDirector.mdb is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the files reside.

Symptom

Error: \GentranDirector.mdb is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the files reside.

Cause

The ODBC settings to the database file GentranDirector.mdb have been changed or have become corrupted.

Resolving The Problem

  1. Using the Windows Search (Find) function, determine where the file GentranDirector.mdb is located. That should be C:\Program Files\Commerce Connection32\Database if you are on version 5.3.01 or 5.4, or C:\DirectorConnection\Database if you are on version 5.5.
  2. Go to Tools > Configuration in the software.
  3. Click the Stop button and then answer "yes" to the check prompt.
  4. Close the Configuration window, and then close Gentran:Director.
  5. Open the Windows Control Panel and go to Administrative Tools > Data Sources (ODBC).
  6. Click on the System DSN tab.
  7. Highlight the words "Gentran:Director" on the line that has that in the Name column and "Microsoft Access Driver (*.mdb)" in the Driver column.
  8. Click the Configure button.
  9. Click the Select button.
  10. Changing the entries in the Drives and/or Directories fields as necessary, maneuver to the directory where the GentranDirector.mdb file is located.
  11. Select the GentranDirector.mdb file and click OK.
  12. Click OK two more times to exit from Data Sources (ODBC). Note Depending on the status of the program at the time the ODBC entry is changed or becomes corrupted, i.e., whether or not Director is open and the Director Executive is running, the error can occur when trying to start or stop the Director Executive, when trying to open the software, or when trying to uninstall the software.

[{"Product":{"code":"SS6UP7","label":"Sterling Gentran:Director"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF033","label":"Windows"}],"Version":"5.5;5.4;5.3.1","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]