Database Connection Problem

Discussion in 'ASP General' started by Apostolis K., Feb 6, 2004.

  1. Apostolis K.

    Apostolis K. Guest

    I have created a database called "myshop.mdb"
    Then I create a System DSN connected to that database called "OE1"

    The following code retrieves attributes and possible errors from the DSN
    Connection
    ----------------------------------------------------------------------------
    -----------
    <%
    Set myConn=Server.CreateObject("ADODB.Connection")
    myConn.Open "OE1"

    Response.Write "Attributes: " & myConn.Attributes & "<BR>"
    Response.Write "Command TimeOut:" & myConn.CommandTimeout & "<BR>"
    Response.Write "Connection String:" & myConn.ConnectionString & "<BR>"
    Response.Write "Connection Timeout" & myConn.ConnectionTimeout & "<BR>"
    Response.Write "Cursor Location:" & myConn.CursorLocation & "<BR>"
    Response.Write "Default Database:" & myConn.DefaultDatabase & "<BR>"
    Response.Write "Isolation Level:" & myConn.IsolationLevel & "<BR>"
    Response.Write "Mode:" & myConn.Mode & "<BR>"
    Response.Write "Provider:" & myConn.Provider & "<BR>"
    Response.Write "State:" & myConn.State & "<BR>"
    Response.Write "Version:" & myConn.Version & "<BR>"

    FOR EACH item IN myConn.Errors
    Response.Write "Number:" & item.Number & "<BR>"
    Response.Write "NativeError:" & item.NativeError & "<BR>"
    Response.Write "Source:" & item.Source & "<BR>"
    Response.Write "SQLState:" & item.SQLState & "<BR>"
    Response.Write "Description:" & item.Description & "<BR>"
    NEXT

    myConn.Close
    %>
    ----------------------------------------------------------------------------
    -----------


    When I run the script I get this error

    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.
    Apostolis K., Feb 6, 2004
    #1
    1. Advertising

  2. http://www.aspfaq.com/show.asp?id=2009

    --
    Manohar Kamath
    Editor, .netBooks
    www.dotnetbooks.com


    "Apostolis K." <> wrote in message
    news:...
    > I have created a database called "myshop.mdb"
    > Then I create a System DSN connected to that database called "OE1"
    >
    > The following code retrieves attributes and possible errors from the DSN
    > Connection
    > --------------------------------------------------------------------------

    --
    > -----------
    > <%
    > Set myConn=Server.CreateObject("ADODB.Connection")
    > myConn.Open "OE1"
    >
    > Response.Write "Attributes: " & myConn.Attributes & "<BR>"
    > Response.Write "Command TimeOut:" & myConn.CommandTimeout & "<BR>"
    > Response.Write "Connection String:" & myConn.ConnectionString & "<BR>"
    > Response.Write "Connection Timeout" & myConn.ConnectionTimeout & "<BR>"
    > Response.Write "Cursor Location:" & myConn.CursorLocation & "<BR>"
    > Response.Write "Default Database:" & myConn.DefaultDatabase & "<BR>"
    > Response.Write "Isolation Level:" & myConn.IsolationLevel & "<BR>"
    > Response.Write "Mode:" & myConn.Mode & "<BR>"
    > Response.Write "Provider:" & myConn.Provider & "<BR>"
    > Response.Write "State:" & myConn.State & "<BR>"
    > Response.Write "Version:" & myConn.Version & "<BR>"
    >
    > FOR EACH item IN myConn.Errors
    > Response.Write "Number:" & item.Number & "<BR>"
    > Response.Write "NativeError:" & item.NativeError & "<BR>"
    > Response.Write "Source:" & item.Source & "<BR>"
    > Response.Write "SQLState:" & item.SQLState & "<BR>"
    > Response.Write "Description:" & item.Description & "<BR>"
    > NEXT
    >
    > myConn.Close
    > %>
    > --------------------------------------------------------------------------

    --
    > -----------
    >
    >
    > When I run the script I get this error
    >
    > 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.
    >
    >
    Manohar Kamath [MVP], Feb 6, 2004
    #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. Albert

    ASPX database connection problem

    Albert, Aug 9, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,715
    Albert
    Aug 9, 2003
  2. Maellic
    Replies:
    3
    Views:
    4,288
    Maellic
    Jan 13, 2004
  3. =?Utf-8?B?S0tS?=

    Problem with database connection

    =?Utf-8?B?S0tS?=, Feb 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    280
    =?Utf-8?B?RGF2aWQgQ29lLCBNQ1A=?=
    Feb 16, 2004
  4. Buddy Ackerman

    VERY strange database connection problem

    Buddy Ackerman, Jul 1, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    409
    Buddy Ackerman
    Jul 1, 2005
  5. Mythran
    Replies:
    5
    Views:
    4,923
    Mythran
    Oct 5, 2005
Loading...

Share This Page