cannot access the datebase

Results 1 to 3 of 3

Thread: cannot access the datebase

  1. #1
    Join Date
    Dec 1969

    Default cannot access the datebase

    Hi, I&#039;ve just started learning ASP. I have been doing this exercise where I need to open a ms access database. I copied the code from the book I have, but everytime I try to run it I get an error. According to the message, I have a problem with the connection from the following code lines. <BR><BR>Dim objConn <BR>Set objConn=Server.CreateObject("ADODB.Connection") <BR>objConn.ConnectionString="DSN=test1.dsn" <BR>objConn.Open <BR><BR>The error message I get: <BR><BR>Error Type: <BR>Microsoft OLE DB Provider for ODBC Drivers (0x80004005) <BR>[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file &#039;(unknown)&#039;. It is already opened exclusively by another user, or you need permission to view its data. <BR><BR><BR>I have tried the same code lines on my friend&#039;s computer and it worked fine. But since I need to use my own computer to learn ASP, so I need to know what&#039;s going wrong here. Please let me know if you have any ideas, Thanks. My OS is windowXP.

  2. #2
    Join Date
    Dec 1969

    Default Read the error message...

    It *is* telling you the reason, honest.<BR><BR>If you have the Access DB opened for write any place else (yes, including via Access), then it can&#039;t be opened in your page.<BR><BR>If that&#039;s not the problem then, indeed, it is a permissions problem.<BR><BR>If you use WINDOWS EXPLORER to get to the file and the click on PROPERTIES to view same, do you see a "tab" for "Security"?? If not, you need to modify your VIEW of folders:<BR>- From Windows Explorer (or from My Computer), click on the "Tools" menu.<BR>- Click on the "Folder options" menu item.<BR>- Click on the "View" tab<BR>- Find the checkbox labelled "Use simple file sharing (Recommended)"<BR>- *UNCHECK* it!<BR>- Click on OKAY to get out of the dialog<BR><BR>*NOW* you should have a "Security" tab on every folder property and every file property. *NOW* you can assign full permissions to "IUSR_xxx" (where xxx is the name of your computer) for both the ".mdb" file *and* the folder it is contained in.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default or try this ......

    this is just another way to sort out any permissions problems.<BR><BR>I have had that same problem before when using XP, heres how I got around it:<BR><BR>Go to control panel<BR>Then to Administritive tools<BR>Then click on Internet Information Services<BR>Then Default website<BR>and then go to the folder name you have your database stored, right click, go to all tasks and the permissions wizard.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts