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

Cannot open database. 1

Status
Not open for further replies.

svsuthar1

Programmer
Jul 6, 2004
135
US
Hey Team,

I have the following error yet I don't have the database open. I am not sure why it would say this.

Error Type:
Microsoft JET Database Engine (0x80004005)
The Microsoft Jet database engine cannot open the file 'C:\Inetpub\ It is already opened exclusively by another user, or you need permission to view its data.
/Default.asp, line 56
 
Source lines of opening your database please? By example LINE56
 
Does someone else have the DB open in exclusive mode? Do you have the requisite IIS permissions to open the DB through ASP?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
The following is the code that opens the database....

path="C:\Inetpub\
Set objconn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString= "PROVIDER=MICROSOFT.JET.OLEDB.4.0;" & _
"DATA SOURCE=" & path
objConn.Open


The code worked fine till this morning when I came back to work it gave me this problem. I have shut the PC and started up again, but no luck.
 
Does the IUSR account have read/write/delete (modify) permissions on the folder with the DB in?

Tony
________________________________________________________________________________
 
I think there is something wrong with permissions.
Look if IUSR_MACHINENAME has acces to the database.
MACHINENAME is the name of your machine/server.
 
Yes the IUSR has all access to the folder.

Samir
 
Checking and Setting up the Correct Permissions on the IIS Server

If you are using an ASP application, or writing an ASP application, that requires that you write data to a database or a text file then you will need to check and if necessary change the permissions on the server so that you have write as well as read permissions on the directory, and database or text file, you wish to write too.

To check or change the permissions on the server go to Windows Explorer and do the following (for NT and Win 2K users only using NTFS file system, Win9x has no permissions to change): -

1. Right click on the directory containing the database or text file.

2. Click on 'Properties'.

3. Choose the 'Security' tab form the dialog box window.

4. Uncheck 'Allow inheritable permissions from parent to propagate to this object', from the bottom of the dialog box.

5. Next, click on the 'Add' button at the top left of the window.


6. Next the 'Select Users or Groups' dialog box will open, highlight 'IUSR_MyComputer' account from the list by clicking on it. Where 'MyComputer' is this will be the name of your computer. 'IUSER' is the Internet Guest Account setup by default when IIS is installed on the system.


7. Next click on the 'Add' button in the middle left of the dialog box. You should then see 'MyComputer\IUSER_MyComputer' appear in the box in the bottom half of the dialog box. Again where 'MyComputer' is will be the name of your computer.

9. Now click on the 'OK' button at the bottom right of the 'Select Users or Groups' dialog box.

10. You should now be back at the 'Security Properties' dialog box where the top box should now contain the 'Internet Guest Account (MyComputer\IUSER_MyComputer)'.

11. Highlight the 'Internet Guest Account (MyComputer\IUSER_MyComputer)' by clicking on it in the top box.

12. Select 'Read' and 'Write' permissions for this account by checking the boxes at the bottom of the window (If you are not to worried about security you could check all the boxes to make sure that you have no problems with permissions).

13. Next repeat all the steps above on the database or text file itself, to make sure the database or text file also has the correct permissions.

Windows XP Pro users please note: -
Although the instructions above are for NT4/Win2k it is almost the same in XP Pro, but you must first turn off 'Simple File Sharing' from 'Folder Options' found in the Control Panel.

Security note: -
For extra security to prevent hackers from downloading Access databases and getting hold of sensitive data like passwords, you should place any Access databases outside of the root of your web site in a private folder that is not accessible using a web browser.
 
Thanks TheCount, I have followed your steps and it's running..

My question is I did not have this problem before, how come now. The database was not even open. The processes also did not show anything being open.

I guess by setting that account up and giving the rights made it work..

Can anyone explain why I had to do this. I have been using this connection for long time and never had this problem.

Samir
 
I have had similar problems where the DB suddenly stopped working even though nothing was changed. I like to think that it is just another example of why Access should not be used for Web purposes. That said I still have to use it for a few sites that I manage but given a choice I would go with SQL Server every time.



Tony
________________________________________________________________________________
 
Thanks everyone,

I guess I learned something new.. I thank everyone who helped me get this site back up...

Thanks all,

Samir
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top