database connection

Discussion in 'ASP General' started by John Doe, Sep 28, 2003.

  1. John Doe

    John Doe Guest

    When I want to connect to my access database I do this :
    set adoCon = server.CreateObject ("adodb.connection")
    adoCon.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    Server.MapPath("******.mdb") & ";Persist Security Info=False"

    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sqlstring, adoCon

    This works fine, I do have one question though. If I have the access file
    opend to for instance to add a record or something, if someone then try to
    access the database through asp the user get's a white error page with the
    text
    "Error Type:
    Microsoft JET Database Engine (0x80004005)
    Could not use ''; file already in use.
    /d042004/news.asp, line 55"

    Is there a way that I still show my html page just without the asp stuff,
    maybe add my own error message "Database down due to maintence. Please try
    again" or something.
    John Doe, Sep 28, 2003
    #1
    1. Advertising

  2. John Doe

    Bob Barrows Guest

    John Doe wrote:
    > When I want to connect to my access database I do this :
    > set adoCon = server.CreateObject ("adodb.connection")
    > adoCon.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    > Server.MapPath("******.mdb") & ";Persist Security Info=False"
    >
    > Set rs = Server.CreateObject("ADODB.Recordset")
    > rs.Open sqlstring, adoCon
    >
    > This works fine, I do have one question though. If I have the access
    > file opend to for instance to add a record or something, if someone
    > then try to access the database through asp the user get's a white
    > error page with the text
    > "Error Type:
    > Microsoft JET Database Engine (0x80004005)
    > Could not use ''; file already in use.
    > /d042004/news.asp, line 55"
    >
    > Is there a way that I still show my html page just without the asp
    > stuff, maybe add my own error message "Database down due to
    > maintence. Please try again" or something.


    See this message:
    http://tinyurl.com/oy5q
    And these articles:
    http://www.aspfaq.com/show.asp?id=2062 - updatable cursor
    http://www.aspfaq.com/show.asp?id=2009 - 80004005 errors

    HTH,
    Bob Barrows
    Bob Barrows, Sep 28, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mythran
    Replies:
    5
    Views:
    4,927
    Mythran
    Oct 5, 2005
  2. Dave Johnson

    Using Connection Class VS Connection Module

    Dave Johnson, Dec 9, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    619
    Dave Johnson
    Dec 11, 2005
  3. Linus Nikander
    Replies:
    5
    Views:
    530
  4. Replies:
    3
    Views:
    40,179
    Roedy Green
    Nov 16, 2005
  5. R
    Replies:
    1
    Views:
    562
Loading...

Share This Page