Sunil
Sunil

Reputation: 163

[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path

I have created DSN for Mapped drive like this:-

 Y:\\192.168.2.5\data\db.accdb

Now i am accessing this database from java application using sun jdbc odbc drivers. Application is running on Window 2008 64-bit system and database is running on Window Server 2012 64-bit system.

When I ran this application with Java 64-bit it throw error of architecture mismatch.

Then i install java of 32-bit and the above problem is resolved. But getting another problem as

  java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] '(unknown)' is
  not a valid path. Make sure that the path name is spelled correctly and that yo
  u are connected to the server on which the file resides. 

How to resolve this problem?

enter image description here

See the database path witch is not valid for my program. This path is mapped with Y:\192.168.2.5\shared drive.

Upvotes: 5

Views: 16053

Answers (6)

Hannington Mambo
Hannington Mambo

Reputation: 1090

This is only for Windows hosting setup:

I was doing this with Windows Server using Plesk and after going through some trouble getting the path right, i finally managed to do it. So, basically, go to your file folder system and get the entire path of your database and put it in the database path like this:

enter image description here

C:\inetpub\vhosts\websitefolder\subdomain.domain.com\DataFolder\databasename.mdb

I had hoped there is a way to shorten it like this

~\Datafolder\databasename.mdb

but I wasn't successful. So I will use the one that works for me for now.

I am also still curious why I couldn't use .accdb...?

Also not that the correct Access Database Engine should be installed in your server

Upvotes: 0

Todd Harvey
Todd Harvey

Reputation: 347

I just fixed this connection string by spelling out the fully qualified dns name, instead of using the mapped drive name "H:":

BAD

sCN_ODBC = @"Driver={Microsoft Access Driver (*.mdb)}; Dbq=H:\vol01\IIT\Apps\Applications\MFG\User.mdb;Trusted_Connection=yes";

GOOD

sCN_ODBC = @"Driver={Microsoft Access Driver (*.mdb)}; Dbq=\\tstorage.iit.edu\depts$\vol01\IIT\Apps\Applications\MFG\User.mdb;Trusted_Connection=yes";

I'm using C# dotnet , other posts on this thread are java and php

Upvotes: 0

dhuvvamundha
dhuvvamundha

Reputation: 17

so I had a similar, if not the same, issue.

had installed wamp. was using php to access a mdb file on the network. and I got the msg saying path not found.

so what I did was, created a normal dsn configuration and then how it looked like was something like this: Y:\mydata.mdb

I searched for "y:\mydata.mdb" on regedit and found it. changed it to full path for example like "\serverip\serverfolder\mydata.mdb"

This was done on administrative user.

I refreshed the web page and it worked. Hope this helps somebody.

p.s. written on a rush. sorry if I wasn't clear.

Upvotes: 0

Chas Callaway
Chas Callaway

Reputation: 11

I have discovered, it seems, that a mapped network drive is not available to IIS as it runs as a service. In addition, I have been unable to create a DSN entry with a UNC path. So, I created the DSN with a local database, then changed the path in Regedit. What a pain. Be sure to provide proper credentials (UID and PWD).

Upvotes: 1

ggenglish
ggenglish

Reputation: 1678

To summarize I bet this was a permission problem.

Was having the exact same error message and was baffled because it was working earlier. It was because I was changing versions of Tomcat on my end and it was running without permission to access my db resource.

Upvotes: 0

Elliott Frisch
Elliott Frisch

Reputation: 201447

Use a valid PATH, the problem with this

Y:\\192.168.2.5\data\db.accdb

Is that \ is a special character. You need,

Y:\\192.168.2.5\\data\\db.accdb

or

Y:/192.168.2.5/data/db.accdb

Upvotes: 0

Related Questions