Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open file directly on the server

Status
Not open for further replies.

TommyIndigo

Programmer
Sep 14, 2000
67
US
Hi,

I have an Access DB (2007) stored on a server. A function within this DB opens a data file for reading and imports it into the database. The function includes a path to the file to be opened.

Users are connecting to this database via a network share. It seems the function to open the data file is using the context of their client machine, rather than the server. So, that function is failing since they don't have that path mapped to the data file.

I'm assuming since the DB is being opened via a share that essentially the database is running on the client machine, hence is looking for the path in relation to the client.

I don't want them to need to map a path to this file. Since the DB resides on the server, I'd like the path to be relative to the DB itself (i.e. on the server), rather than the client. Is this possible?

Thanks in advance for your help.

 
Not unless you switch the back end to a server side database (SQL Server, MySQL etc).
Remember as far as Windows is concerned, your access database is just a file on disk accessed via a share, and your clients (PCs / users) need permissions to be able to access it appropriately.
The code is always executed on the client PC, there is no way it can be run on the server.

A possible way to do this without easily exposing the data file would be to set up a hidden share on your server to a folder with this file on it, locked down with just access to the folder containing this file, then use a UNC pathname in your client application to access it so that no drive mapping is required.
You will still need to ensure that access to the files on the server itself are secured and that only appropriate people have access to the server and any data backups.

John
 
Thanks for the helpful suggestions. I don't know why I didn't think of using the \\server\share\file method! DUH!

It is good in general to know the code is executed on the client, as if it was saved and executed on their machine. That knowledge may help me not need to chase my tail in the future.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top