467,905 Members | 1,849 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,905 developers. It's quick & easy.

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
  • viewed: 7524
Share:
3 Replies
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Scott Castillo | last post: by
3 posts views Thread by mark.jerrom | last post: by
reply views Thread by John Fleming | last post: by
2 posts views Thread by le0 | last post: by
3 posts views Thread by Nathan Sokalski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.