Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Microsoft OLE DB

  1. #11
    Join Date
    Apr 2003
    Posts
    13,269
    Rep Power
    34

    Default Re: Microsoft OLE DB

    Hmm, well it would be very strange that it didn't have a connection to a database. Unless you missed a file somewhere.
    You want to post the contents of that file (Search_Screen_Body.asp) or email it to me. I'll take a quick look at it.
    "The best software is the one that fits your needs." - A_A

    Virus free since: date unknown
    Anti-virus free since: August 2008

  2. #12
    Join Date
    Apr 2003
    Posts
    13,269
    Rep Power
    34

    Default Re: Microsoft OLE DB

    Ok I got your file, and I see the problem. It seems you were using a DSN connection.
    Code:
    objconn.connectionstring="dsn=TestAccidentDB"
    If you didn't have this connection already setup on your IIS server, then you would get the error you were getting first.

    So you will need to remove the code I told you to insert into your file.

    Then you will need to setup a DSN connection to your database. (You're using XP I presume?)

    Click Start --> Run...
    Type: odbcad32
    Click Ok.

    The Microsoft ODBC Administrator should open. Under the User DSN tab click the Add button.
    Choose the database type you will be connecting to. In this case it will be Microsoft Access Driver (*.mdb).
    Then enter the name of this connection in the Data Source Name field. Call it TestAccidentDB.
    Click the Select button and choose the database you want to connect to.
    Then click Ok and you're done.

    Your asp scripts should now use that connection to connect to your database.
    "The best software is the one that fits your needs." - A_A

    Virus free since: date unknown
    Anti-virus free since: August 2008

  3. #13
    Join Date
    Jun 2003
    Posts
    456
    Rep Power
    0

    Default Re: Microsoft OLE DB

    Quote Originally Posted by Arch_Angel
    Ok I got your file, and I see the problem. It seems you were using a DSN connection.
    Code:
    objconn.connectionstring="dsn=TestAccidentDB"
    If you didn't have this connection already setup on your IIS server, then you would get the error you were getting first.
    I did that and now i am getting a different error
    Code:
    Error Type:
    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.
    /aipreporting/password.asp, line 25
    and should it be setup under USER DSN or SYTEM DSN

  4. #14
    Join Date
    Apr 2003
    Posts
    13,269
    Rep Power
    34

    Default Re: Microsoft OLE DB

    It should be setup under User DSN.

    There are a couple reasons why you get that error. Here are some of them and the resolutions.

    REASON 1: The account that Microsoft Internet Information Server (IIS) is using (which is usually IUSR) does not have the correct Windows NT permissions for a file-based database or for the folder that contains the file.
    SOLUTION 1: Check the permissions on the file and the folder. Make sure that you have the ability to create and/or destroy any temporary files. Temporary files are usually created in the same folder as the database, but the file may also be created in other folders such as the WINNT folder. For additional information about how to identify which folder does not have the correct permissions and how to configure temporary files, click the following link to view the article in the Microsoft Knowledge Base:

    253604 Microsoft Access 97 database connectivity fails in Active Server Pages

    If you use a network path to the database (UNC or mapped drive), check the permissions on the share, the file, and the folder.

    REASON 2: The file and the data source name are marked as Exclusive.
    SOLUTION 2: Verify that the file and the data source name (DSN) are not marked as Exclusive. To do this, open your ODBC Administration panel again. Select the DSN connection and click the Configure button. In the new window that opened, click the Options>> button and make sure the Exclusive option is NOT checked.

    REASON 3: Another process or user has the Access database open.
    SOLUTION 3: The "other user" may be Microsoft Visual InterDev. Close any Visual InterDev projects that contain a data connection to the database. If close MS Access if you have it open.

    REASON 4: The error may be caused by a delegation issue. Check the authentication method (Basic versus NTLM), if any. If the connection string uses the Universal Naming Convention (UNC), try to use Basic authentication or an absolute path such as C:\Mydata\Data.mdb. This problem can occur even if the UNC points to a resource that is local to the IIS computer.
    SOLUTION 4: Simplify. Use a System DSN that uses a local drive letter. If necessary, move the database to the local drive to test.

    REASON 5: This error may also occur when you access a local Microsoft Access database that is linked to a table where the table is in an Access database on a network server.
    SOLUTION 5: Follow the instructions in the following article to work around this problem:

    189408 FIX: ASP fails to access network files under IIS 4.0 and IIS 5.0
    "The best software is the one that fits your needs." - A_A

    Virus free since: date unknown
    Anti-virus free since: August 2008

  5. #15
    Join Date
    Jun 2003
    Posts
    456
    Rep Power
    0

    Question Re: Microsoft OLE DB

    I did the User DSN and set where the file should be and Call it the correct name that I see in the code and I am still get the same error as if it's not seeing the data source name. I am back at the first error

    When I use the first code you gave me to try I am able to go in but I got the second error...

    and all the DSN is setup as how you instruct me.

    So how can I work around this...

  6. #16
    Join Date
    Apr 2003
    Posts
    13,269
    Rep Power
    34

    Default Re: Microsoft OLE DB

    So I am guessing you didn't try any of the solutions I posted?

    - Make sure you don't have MS Access opened.
    - Go into your folder where your database is, and make sure there isn't a .LDB file in there. If there is, delete it.
    - Check that the DSN you created doesn't have the "Exclusive" option checked. As I posted previously, open your ODBC Admin, select your DSN. Click Configure. Click Options and make sure the "Exclusive" option is not checked.

    If you checked those and still having the problem, then it is a permission issue. You will need to give permission to the IUSR_<machine_name> and IWAM_<machine_name> account to the database file, and the folder which contains the database file.

    To do this
    >> browse to your database file using windows explorer.
    >> right click the file and select Properties
    >> click the Security tab.
    >> Select the accounts I mentioned before, and make sure they have Read and Write permissions.
    >> Click Ok
    >> Do this for the folder the database is in too.

    Note: if you don't see the IUSR_<machine_name> or IWAM_<machine_name> account, look for the user group "Web Anonymous Users" which contains both accounts and give it the Read/Write permissions.

    Note 2: Also make sure you are not using Simple File Sharing. In windows explorer go to Tools >> Folder Options... >> View tab. Make sure the option Use simple file sharing (Recommended) is unchecked.
    "The best software is the one that fits your needs." - A_A

    Virus free since: date unknown
    Anti-virus free since: August 2008

  7. #17
    Join Date
    Apr 2003
    Posts
    13,269
    Rep Power
    34

    Default Re: Microsoft OLE DB

    Gwiz, any luck with it?
    "The best software is the one that fits your needs." - A_A

    Virus free since: date unknown
    Anti-virus free since: August 2008

  8. #18
    Join Date
    Jun 2003
    Posts
    456
    Rep Power
    0

    Default Re: Microsoft OLE DB

    I had step away from it for a moment becuase it was hurting mi head..
    but I will see if I can start it up again this afternoon.

  9. #19
    Join Date
    Jun 2003
    Posts
    456
    Rep Power
    0

    Default Re: Microsoft OLE DB

    I have setup it up on a different computer and everything is fine now. I follwed your steps and it went through with out a problem... It could be some other configuration that is on the computer.

    Well I am going to configuring IIS for windows server 2003 anything different I should do.

  10. #20
    Join Date
    Apr 2003
    Posts
    13,269
    Rep Power
    34

    Default Re: Microsoft OLE DB

    Well I am going to configuring IIS for windows server 2003 anything different I should do.
    I haven't had much experience with windows 2003. But if you run into any trouble, I'm sure we can find a workaround or a fix for it.
    "The best software is the one that fits your needs." - A_A

    Virus free since: date unknown
    Anti-virus free since: August 2008

Posting Permissions

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