472,783 Members | 1,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,783 software developers and data experts.

Accessing an Access Database

Hi all,

I am using VB script in ASP to access a MS Access database. This works fine
until I want to access the same db placed on a file share.

The code I am using is...

'create connection object
Set db = Server.CreateObject("ADODB.Connection")
'specify the database provider
db.Provider = "Microsoft.Jet.OLEDB.4.0"

'declare the location of the database
db.ConnectionString = "Data Source=\\fileshare\directory\database.mdb"

I get an error to the effect...

[Microsoft][ODBC Microsoft Access 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.[Microsoft][ODBC
Microsoft Access 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.

I guess this is because the remote file share can't authenticate me as the
effective user of the page is anonymous.

Does anybody know how I would be able to get this to work?

N.B The users who are using the website will be logging onto the same domain
that the file share is on and the file share has the correct permissions set
for the users that need access.

-Cheers, Russell.
Nov 17 '05 #1
3 7839
Try creating a DSN configured to access the database with an account with
sufficient privileges.
Then change your connection string to;

db.ConnectionString = "DSN=YourDSNName"

Let us know if that works

"Russell Read [MSFT]" <ru******@online.microsoft.com> wrote in message
news:un*************@tk2msftngp13.phx.gbl...
Hi all,

I am using VB script in ASP to access a MS Access database. This works fine until I want to access the same db placed on a file share.

The code I am using is...

'create connection object
Set db = Server.CreateObject("ADODB.Connection")
'specify the database provider
db.Provider = "Microsoft.Jet.OLEDB.4.0"

'declare the location of the database
db.ConnectionString = "Data Source=\\fileshare\directory\database.mdb"

I get an error to the effect...

[Microsoft][ODBC Microsoft Access 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.[Microsoft][ODBC
Microsoft Access 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.

I guess this is because the remote file share can't authenticate me as the
effective user of the page is anonymous.

Does anybody know how I would be able to get this to work?

N.B The users who are using the website will be logging onto the same domain that the file share is on and the file share has the correct permissions set for the users that need access.

-Cheers, Russell.

Nov 17 '05 #2
Hi George,

Thanks for the info - however it didn't work :(

I created a System DSN on the server and pointed it to the Access db on the
file share. This created OK and to test it I opened Excel and populated a
Pivot Table with the data just to check the DSN was working properly - this
all worked fine.

I then changed the code I had so that it was just...

Set db = Server.CreateObject("ADODB.Connection")
db.ConnectionString = "DSN=myDSNshare"

....and when I try and load the page, after a while I get the error

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access 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.

Can you think of anything else I could try?

-Cheers, Russell.


"George Durzi" <gd****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Try creating a DSN configured to access the database with an account with
sufficient privileges.
Then change your connection string to;

db.ConnectionString = "DSN=YourDSNName"

Let us know if that works

"Russell Read [MSFT]" <ru******@online.microsoft.com> wrote in message
news:un*************@tk2msftngp13.phx.gbl...
Hi all,

I am using VB script in ASP to access a MS Access database. This works

fine
until I want to access the same db placed on a file share.

The code I am using is...

'create connection object
Set db = Server.CreateObject("ADODB.Connection")
'specify the database provider
db.Provider = "Microsoft.Jet.OLEDB.4.0"

'declare the location of the database
db.ConnectionString = "Data Source=\\fileshare\directory\database.mdb"

I get an error to the effect...

[Microsoft][ODBC Microsoft Access 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.[Microsoft][ODBC
Microsoft Access 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.

I guess this is because the remote file share can't authenticate me as the effective user of the page is anonymous.

Does anybody know how I would be able to get this to work?

N.B The users who are using the website will be logging onto the same

domain
that the file share is on and the file share has the correct permissions

set
for the users that need access.

-Cheers, Russell.


Nov 18 '05 #3
INFO: Permissions to Connect to a Remote Access Database from ASP.NET

http://support.microsoft.com/default...b;en-us;307901
"Russell Read [MSFT]" <ru******@online.microsoft.com> wrote in message
news:un*************@tk2msftngp13.phx.gbl...
Hi all,

I am using VB script in ASP to access a MS Access database. This works fine until I want to access the same db placed on a file share.

The code I am using is...

'create connection object
Set db = Server.CreateObject("ADODB.Connection")
'specify the database provider
db.Provider = "Microsoft.Jet.OLEDB.4.0"

'declare the location of the database
db.ConnectionString = "Data Source=\\fileshare\directory\database.mdb"

I get an error to the effect...

[Microsoft][ODBC Microsoft Access 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.[Microsoft][ODBC
Microsoft Access 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.

I guess this is because the remote file share can't authenticate me as the
effective user of the page is anonymous.

Does anybody know how I would be able to get this to work?

N.B The users who are using the website will be logging onto the same domain that the file share is on and the file share has the correct permissions set for the users that need access.

-Cheers, Russell.

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Scott Castillo | last post by:
Is it possible to access an SQL Server database from a Javascript client? I know you can transfer variables from middleware to Javascript client, but was wondering if you can directly access...
3
by: prodirect | last post by:
Hi all, I hope someone can help me. I've recently created a database and wanted to put it up on an ftp sight so that multiple people could access the same tables at the same time from different...
3
by: mark.jerrom | last post by:
I'm fairly new to this Web Service game so please feel free to suggest something different if it looks like i'm completely off track! I'm trying to write an application that runs on a Pocket PC...
0
by: John Fleming | last post by:
Hello, I am building a web application with the following components: 2 Web Servers - Windows Server 2003 - IIS 6 - .Net Framework version 2.0 - Reside in Domain A 2 Clustered Database...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
5
by: samadams_2006 | last post by:
I'm having a problem in accessing a Microsoft Access Database in a VB.NET Web Application. It's so straight forward, I thought I'd walk you through all the details here: 1) I have a .NET Web...
5
by: Mike | last post by:
I'm having trouble accessing SQL2005 Standard Edition as a second instance of SQL Server where the first instance is SQL 2000 Enterprise Edition. I installed SQL 2005 as a named instance...
2
by: le0 | last post by:
guys, this is my first time to deploy website to the server, but every time i access the page this error always appears. ...
3
by: Nathan Sokalski | last post by:
When I attempt to access a Microsoft Access database from my website, I recieve the following error: Server Error in '/' Application....
4
by: Noy B | last post by:
Hi, I have developed a small application that is using a MSAccess DB. the problem is that it was developed on a machine where the application and the DB are both located. now it needs to be...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.