Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Database Connection Problem

Reply
Thread Tools

Database Connection Problem

 
 
Apostolis K.
Guest
Posts: n/a
 
      02-06-2004
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.


 
Reply With Quote
 
 
 
 
Manohar Kamath [MVP]
Guest
Posts: n/a
 
      02-06-2004
http://www.aspfaq.com/show.asp?id=2009

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


"Apostolis K." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Database Connection - Not Associated With Trusted Connection Mythran ASP .Net 5 10-05-2005 10:50 PM
website connection to database time out problem : login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' Maellic ASP .Net 3 01-13-2004 06:21 AM
ASPX database connection problem Albert ASP .Net 0 08-08-2003 11:07 PM



Advertisments