oursgris
oursgris

Reputation: 2882

Access to a MDB file without the file system access in ASP .Net

I have an input MDB file coming from a third party program. I have to read it in my asp .net application and then ask some related form to the final user.

At the moment, I can write the mdb file on the filesystem and read it, it works but sometimes this feature doesn't work and I have to restart the server.

The customer want to externalize the server and I can't write to the file system or even restart it so I'd like to read the mdb file in asp .net from a MemoryStream or maybe execute a conversion to a most readable format like XML, but I don't think it is possible.

So I'm looking for a solution to preprocess the access file.

I don't think it is possible to read it via javascript (only vbscript).

The only way I imagined is :

that sounds me complicated for the final user

does someone have some feeling or idea about that case ?

Edit

The mdb file is uploaded via a http form contained into the web form.

Sometimes, after the upload, the application throw an exception and it can't use the c:\windows\temp. I have an error : Access not possible on the specified file.

I don't have a better information because the application is located in the internal network of the customer and I'm not there. So I have to ask them to reboot it.

Upvotes: 0

Views: 1244

Answers (1)

user2316116
user2316116

Reputation: 6814

Quote: Configuring Permissions for an Access Database

When a Web application uses an Access database, the application must have Read permission to the .mdb file so the application can access the data. Additionally, the application must have Write permission to the folder that contains the .mdb file. Write permission is required because Access creates an additional file that has the extension .ldb in which it maintains information about database locks for concurrent users. The .ldb file is created at run time. [...] Therefore, to use an Access database in an ASP.NET Web application, you must configure the folder that contains the Access database to have both Read and Write permissions for the local ASPNET user account.

In other words, if you have no permissions to read and write you will not be able to work with .mdb.

There are following options available

  1. If permissions cannot be done due to security reasons, but your web server has an access to the .mdb file location (both located in same network) then your client could setup a scheduled job which will backup/copy .mdb to another location where asp.net could have permissions to work with .mdb. This however will be a problem for syncing backup .mdb to production .mdb.
  2. Setup a webservice to update .mdb. It will be hosted on the server where .mdb is located and will have all required permissions. Your application will work with .mdb through the webservice and does not require any permissions on .mdb.
  3. Replace .mdb with SQL Server Express

Upvotes: 1

Related Questions