p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: ASP & Remote Access Database


Message #1 by "Dennis van Herk" <d.van.herk@w...> on Wed, 19 Jun 2002 12:17:19
For an assignment at school I have to write an internet-page using ASP. 
This page has to access a Microsoft Access database on another computer in 
the Local Area Network (LAN). So you have a internet-user which approaches 
PC1 (WebServer) and PC1 approaches PC2 (Database) for data from the MS 
Access database (Which is not protected by any password).

This is the source I use:

Set dcnDB = Server.CreateObject("ADODB.Connection")
   dcnDB.ConnectionString = _
        "Provider=Microsoft.Jet.OLEDB.4.0;" _
	& "Data Source=\\PC2\Directory\database.mdb;" _
	& "Jet 4.0 OLEDB:database"
dcnDB.Open

When I try a test-run of the code, I get:

Microsoft JET Database Engine (0x80004005)
The Microsoft Jet database engine cannot open the file '\\PC2
\Directory\database.mdb'. It is already opened exclusively by another 
user, or you need permission to view its data.

Can anyone help me with this problem.

I guess it has to do something with:
- permissions on PC2
- some settings in Internet Information Server

But I can't get it right.

Maybe someone can explain to me how to set up such an development-
environment ??

Thank you all, already, for all your help.

Greetings
Dennis van Herk (The Netherlands)
Message #2 by Sam Clohesy <sam@e...> on Wed, 19 Jun 2002 12:19:00 +0100
right click the dbase and check it is not locked
Check the path to the dbase - is PC2 a physical path to dbase? is PC2
accessable via your network?- you may have to use a Server.Mappath to find
dbase on other machine

Ta
Sam

-----Original Message-----
From: Dennis van Herk [mailto:d.van.herk@w...]
Sent: 19 June 2002 13:17
To: ASP Databases
Subject: [asp_databases] ASP & Remote Access Database


For an assignment at school I have to write an internet-page using ASP. 
This page has to access a Microsoft Access database on another computer in 
the Local Area Network (LAN). So you have a internet-user which approaches 
PC1 (WebServer) and PC1 approaches PC2 (Database) for data from the MS 
Access database (Which is not protected by any password).

This is the source I use:

Set dcnDB = Server.CreateObject("ADODB.Connection")
   dcnDB.ConnectionString = _
        "Provider=Microsoft.Jet.OLEDB.4.0;" _
	& "Data Source=\\PC2\Directory\database.mdb;" _
	& "Jet 4.0 OLEDB:database"
dcnDB.Open

When I try a test-run of the code, I get:

Microsoft JET Database Engine (0x80004005)
The Microsoft Jet database engine cannot open the file '\\PC2
\Directory\database.mdb'. It is already opened exclusively by another 
user, or you need permission to view its data.

Can anyone help me with this problem.

I guess it has to do something with:
- permissions on PC2
- some settings in Internet Information Server

But I can't get it right.

Maybe someone can explain to me how to set up such an development-
environment ??

Thank you all, already, for all your help.

Greetings
Dennis van Herk (The Netherlands)
Message #3 by d.van.herk@w... on Wed, 19 Jun 2002 13:20:26 +0200
PC2 is accessible through the network.
The path is correct, I copied it from the Windows Explorer.
It's a physical path.

Can you give me an example on how to use the Server.Mappath ?

Thanks Dennis

> right click the dbase and check it is not locked
> Check the path to the dbase - is PC2 a physical path to dbase? is PC2
> accessable via your network?- you may have to use a Server.Mappath to find
> dbase on other machine
> 
> Ta
> Sam
> 
> -----Original Message-----
> From: Dennis van Herk [mailto:d.van.herk@w...]
> Sent: 19 June 2002 13:17
> To: ASP Databases
> Subject: [asp_databases] ASP & Remote Access Database
> 
> 
> For an assignment at school I have to write an internet-page using ASP. 
> This page has to access a Microsoft Access database on another computer in 
> the Local Area Network (LAN). So you have a internet-user which approaches 
> PC1 (WebServer) and PC1 approaches PC2 (Database) for data from the MS 
> Access database (Which is not protected by any password).
> 
> This is the source I use:
> 
> Set dcnDB = Server.CreateObject("ADODB.Connection")
>    dcnDB.ConnectionString = _
>         "Provider=Microsoft.Jet.OLEDB.4.0;" _
> 	& "Data Source=\\PC2\Directory\database.mdb;" _
> 	& "Jet 4.0 OLEDB:database"
> dcnDB.Open
> 
> When I try a test-run of the code, I get:
> 
> Microsoft JET Database Engine (0x80004005)
> The Microsoft Jet database engine cannot open the file '\\PC2
> \Directory\database.mdb'. It is already opened exclusively by another 
> user, or you need permission to view its data.
> 
> Can anyone help me with this problem.
> 
> I guess it has to do something with:
> - permissions on PC2
> - some settings in Internet Information Server
> 
> But I can't get it right.
> 
> Maybe someone can explain to me how to set up such an development-
> environment ??
> 
> Thank you all, already, for all your help.
> 
> Greetings
> Dennis van Herk (The Netherlands)
> 
> 
> 




  Return to Index