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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Server.MapPath for Connection 1

Status
Not open for further replies.

AnilNe

IS-IT--Management
Dec 31, 2003
31
US
Dear Friends,
When I am using complete the complete physicial path, my connection works.

When I use Server.MapPath, it gives the following error.

The Following is as follows:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xa40 Thread 0xc98 DBC 0x10d70b4 Jet'.

Please suggest the solution for the following problem.

Thanks in advance.
Anil
 
I'm not sure why it works with physical path and doesn't with Server.MapPath().
Other than that, it looks like typical permission problem - usually IUSR_* account cannot create .ldb file:


Btw. keeping database in web folder (necessary for .MapPath() to work) may not be a good idea. Someone can type and download it.
 
Thanks for the help.
So what can be done so that we can prevent our database from direct downloading?
Thanks in advance.
Anil
 
You will need a folder above your and your host server will need to have parent paths enabled, so you can use "../path" to go above the root folder. Many hosts will have this disabled to reduce the risk of directory traversal hack attacks.

Chris.

Indifference will be the downfall of mankind, but who cares?
 
One good trick is to rename your database with an .asp extension e.g. mydatabase.asp instead of mydatabase.mdb
That way if anyone tries to download it the server will try to process it as an ASP page and fail.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top