简体   繁体   中英

Connect Ms Access Database on Other Computer using ODBC

How do I connect to a database on other computer using ODBC connection?

Let say, I have a MachineA (Client) and MachineB (Server, where I store the Database). I already share (Set to Everyone: Read/Write) the folder and able to access to the folder from MachineA via Mapped Network Drive.

I already try:

  • using Mapped Network Drive: z:\\DIVA-PC\\database.mdb, got an error when connecting to database (invalid path).

    '(unknown)' isn't 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.

  • using UNC Path, when selecting Database Name: \\DIVA-PC\\database.mdb, but got an error (you don't have permission to open this location)

I'm using:

  • XAMPP
  • Ms.Access Database
  • PHP odbc_connect("DSN name", "username", "password);

There are many reasons why this can fail.

Go in to control panel, select ODBC or Data Sources and locate the MS Access DSN you are using. It should show you the name of the MDB you are using.

Does this file exist? Was it on a mapped drive that is no longer mapped?

If the file exists:

o Check the permissions on the file - it needs to be readable and writable by the user your Apache is running as.

o If on a mapped drive check the user your Apache is running as is the same person who mapped the drive.

o Check your mdb does not have links to another mdb file. If it does you may have to repeat many of these checks for that file too.

o Ensure system environment variable TEMP is set to an existing directory the Apache user has access to.

o Make sure you have permission to create temporary files in the same directory as the mdb file.

o Check another process does not have the mdb open.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM