A
Apostolis K.
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.
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.