Link to home
Start Free TrialLog in
Avatar of Thesan
Thesan

asked on

ODBC connect to *.mdb on mapped network drive?

I'm trying to display the results of a query in an HTML-page that accessible in the intranet. That's why I created *.idc and *.htx files to display the results.

I also set up the data source in ODBC (in the Control Panel).

"Everything" works fine as long as the database resides in c:\whatever. Of course, the database would "normally" be stored on the server. I mapped the directory to X: and changed the data source in ODBC.

However, I'm now getting the following error message:
===============
Error Performing Query

*   [State=S1000][Error=-1032][Microsoft][ODBC Microsoft
Access 97 Driver] The Microsoft Jet database engine cannot
open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.
===============

What could be the problem? Directory was readable for everyone. I'm using Access 97 (as U C above :-), Win NT 4.0 and Peer Web Services 4.0

Any ideas appreciated!
Avatar of T38Jet
T38Jet

I've always had to put the database on the same machine as the IDC file to make those things work. Even with the DSN setup to connect to a database on a mapped drive that everyone can get to. I don't think they like mapped drives.
I don't think your basic problem is related to the fact that your access database is on a mapped drive.  I use nt 4.0, and access 97 with odbc dsn's against access databases on mapped drives on NT 4.0 servers all the time, without problem.  If you notice in oyour DSN, or if you are using something like the .connect property in VB, the actual complete with path file name is included in the dsn for access.mdb's Tha'ts why you shouldn't see the 'unknown' indication if the dsn is correct.  You also need creation rights on the mapped drive, because you will create an *.ldb file (locking crap) when you try to access the mdb.  I'd check to see if you have the full set of rights to the shared folder.
I get the same problem when I run my local version of my page trying to access a data-base on the server.

If you are developing on a local server like me I think you will find when you post your WEB on the real server the problem will go away.

I have to develop my pages on my PC, with a dummy data base, on my local drive, and when I upload it I just change the server address in my connect statment.
The error is more to do with the fact that multiple users are trying to access the DB rather than security probs, you should note, that you should never have to accualy run your access database, this will cause more problems, if you need to work with the data from an access terminal, creat another replica Database, but delete the data table and create a new "linked" table which has the same name, but is linked to the real database.  Use this DB to access the data instead of interupting WEB access.
Avatar of Thesan

ASKER

I'm not using ASP (.connect), I am just using .htx and .idc files.

This will not be uploaded since it is for the INTRAnet and it IS on the "real server" - however, the folks here don't want to run IIS on their main (file) server for reasons of stabilitz and performance. That's why IIS/PWS is supposed to be installed on another machine but (of course) has to access the main database.

I set the rights to "full control for everyone" (on a dummy directory, of course :-)), but it still doesn't work.

Cymbolic: So your "web server" is running on the server, right? Your files are on the same server?
What did you enter as DSN? The mapped drive letter or an absolute network path? I tried both but neither one works :-( The entry is "correct", because I chose it using the "Browse" button - no chance to make a mistake there! I also tried setting access to "read-only".
Also, at the current stage, there isn't anybody else accessing those files!
ASKER CERTIFIED SOLUTION
Avatar of NullTerminator
NullTerminator

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Thesan

ASKER

sounds good :-)

Trouble is: it still doesn't work :-((

This doesn't seem to be a problem with access rights! To check, I logged on as IUSR_MYCOMPUTERNAME at the NT login. I can see and open the *.mdb files with this account.

In a browser, I still get the same error message I posted above (and yes, I did "adjust" the options in PWS and also changed the ODBC-source to an absolute network path (strangely, you cannot "pick" it by browsing, but have to manually enter it!!). Would it be possible to create the mapped drive for the IUSR_... account and choose "reconnect at logon"? Would that correctly map the drive if PWS uses the account??)

Any (more) ideas?? :-(
Yes, if you log on as IUSR_  and map the drive, then PWS should see the mapping, but realise if the machine is rebooted or some one else logs on the mapping might not be valid.

Another way would be to create a script for the .default user to open the mapping for iusr_ .  The script  (batch file) should have the following line

Net use x:  \\theDBServer\theShare   iusrPassword  /user:IUSR_MYCOMPUTER
Avatar of Thesan

ASKER

ohhhh... that's not very nice (having to map sth for everybody just to make PWS happy)

Also, "the Admins" changed their mind and installed IIS on the server - not the "simple queries" work fine, BUT
the database contains linked tables from another database. In order to make the database work on all workstations in the network (regardless of mapping), the linked tables are linked as "\\theServer\Apps\Database\DB\somename.mdb"

For some reason (?), ODBC can't handle those "links". I keep getting the error message:
=============
Error Performing Query

*   [State=S1000][Error=-1032][Microsoft][ODBC Microsoft
Access 97 Driver] The Microsoft Jet database engine cannot
open the file '\\theServer\apps\DB\linkedfile.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
=============

Any ideas about that one? Shouldn't be related to mapping or access rights, because the linked table is in the same directory as the "main database"... any ideas?
So are you saying that IIS is on the same server as the DB?  Mapping is out of the picture?   IUSR_ must have permissions to the folder in which the DB lives, read, write, create.  It needs to be able to create the lock file  (LDB)

1) Access 97 has two versions of the drivers.  I haven't been able to tell them apart.  But if someone with the 'a' drivers has the db open, others with 'a' drivers can open it.  If someone with 'b' drivers has it open, those with 'a' drivers can't. We have two groups of people using a db on webserver.  IIS is in group 'a'.  If a 'b' user has it open IIS fails.  If IIS has it open group 'b' fails. It sucks. If IIS has it open and group 'a' tries, no problem.

2) Resolve first that you can work with the tables local to the first database without problem. Make sure for the initial testing that no other users are connected to the mdb.  If an LDB is present try to delete it.  If you can no one else is active.

3) Test the 'linked' table configuration.  

4) It shouldn't be a problem for admins to make common mappings for the users.  Set it up in there profiles.  This is a common default for every on haviing a common say u: mapped to sys volume.

5) Since for IIS the db1 is linked to db2 in the same directory, don't specify an absolute path.  Only specify db.  Current directory will be assumed.

Have fun,  Just do it one step at a time.  Don't try to link an mdb to an mdb through ODBC, usually it just hangs.

'\0'
GREETINGS!

This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.  Also in the Community Support link is a question on how experts can help, if they wish, on the cleaning of old and abandoned questions.

https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
https://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange