4

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.

Sunil
  • 163
  • 2
  • 2
  • 7

5 Answers5

1

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).

0

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
Elliott Frisch
  • 198,278
  • 20
  • 158
  • 249
  • How to replace special character \ by \\. I am creating System DSN under 'ODBC Data Source Administrator' window. – Sunil Aug 10 '14 at 05:50
  • You aren't going to get a Java exception from the Microsoft control panel. Please clarify your question, and specify your java version. – Elliott Frisch Aug 10 '14 at 16:35
  • 1
    I have created a simple java program for accessing *.accdb database. When this database is on same machine there is no error. But when the database in remote system it throw **'[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path'** exception. For accessing remote database I have created a mapped drive for *.accdb file. Then I created dsn for this mapped file. Please see the image I have attached with this question. – Sunil Aug 11 '14 at 06:17
0

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.

ggenglish
  • 1,668
  • 18
  • 19
0

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.

0

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

Nilesh Thakkar
  • 1,442
  • 4
  • 25
  • 36
Todd Harvey
  • 309
  • 3
  • 4