Solved

Provider error '80004005' unspecified error

Posted on 2001-08-16
18
1,108 Views
Last Modified: 2007-12-19
I am getting the following error in my asp page:

Provider error '80004005' unspecified error

It seems to occur at the line:

schools.ActiveConnection = MM_DSN_STRING

... in the code below:

<!--#include file="../connection.asp" -->
<%
Dim schools__MMColParam
schools__MMColParam = ""
if (Request("SchoolName") <> "") then schools__MMColParam = Request("SchoolName")
%>
<%
set schools = Server.CreateObject("ADODB.Recordset")
schools.ActiveConnection = MM_DSN_STRING
schools.Source = "SELECT * FROM Schools WHERE SchoolName LIKE '%" + Replace(schools__MMColParam, "'", "''") + "%' order by SchoolName"
schools.CursorType = 0
schools.CursorLocation = 2
schools.LockType = 3
schools.Open()
schools_numRows = 0
%>

Any help would be greatly appreciated.  
0
Comment
Question by:mraible
  • 9
  • 5
  • 2
  • +2
18 Comments
 
LVL 1

Author Comment

by:mraible
Comment Utility
MM_DSN_STRING is defined in the file connection.asp - another weird thing that is happing is that if I try to use the variable MM_DSN_STRING more than once in the same file to open a connection, I get the error "file already in use."
0
 
LVL 20

Accepted Solution

by:
Silvers5 earned 50 total points
Comment Utility
1- you need to close all the opened connection recordsets... before reverting to another connection..

also read:

If Setting IUSR permissions on the mdb doesn't work then there aren't any permissions set in the tmp dir try this also..

http://support.microsoft.com/support/kb/articles/Q174/9/43.ASP
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=115



Why does Access give me 'unspecified error' messages?     (262 requests)
Aside from the improper use of MEMO fields (see FAQ #9), this may be caused by the mode in which Access is opened. Unless otherwise specified, IIS opens Access databases with adModeUnknown... which has proven to cause random problems in certain configurations. You can overcome this by setting the mode to adModeReadWrite *before* opening the connection, such as:
 
<%
    cst = "Driver={Microsoft Access Driver (*.mdb)};DBQ="
    cst = cst & server.mappath("/<pathtofile.mdb>")
    set conn = server.createobject("adodb.connection")
    conn.mode = 3 ' adModeReadWrite
    conn.open cst
%>
 
(If you know you have Jet 4.0 installed, you can use the following slightly more efficient method.)
 
<%
    cst = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    cst = cst & server.mappath("/<pathtofile.mdb>")
    set conn = server.createobject("adodb.connection")
    conn.mode = 3 ' adModeReadWrite
    conn.open cst
%>

0
 

Expert Comment

by:akshayajmera
Comment Utility
Hi Mraible

 Will u please give the code of
  <!--#include file="../connection.asp" -->

Akshay
0
 
LVL 1

Author Comment

by:mraible
Comment Utility
Silvers5 - do you recommend using the server.mappath over using a DSN.  I've had a lot of trouble getting the mappath to work - any tips?

The strange thing about this error is that if I wait a few hours - it goes away on my ISP.  This error doesn't occur at all on my local machine.

akshayajmera -
The code for connection.asp is:

<%
' FileName="connection.asp"
' Type="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
MM_DSN_STRING = "DSN=SchoolSponsor"
NOTIFICATION_EMAIL = "matt@raibledesigns.com"
%>
0
 

Expert Comment

by:akshayajmera
Comment Utility
Hi mraible,
 The Error is in this Line

  schools.ActiveConnection = MM_DSN_STRING

  you are assingning the DSN Name to Active Connection Property, that is wrong it requires active connection object.
The Corrected Code for .inc is

<%
' FileName="connection.asp"
' Type="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim Connection
MM_DSN_STRING = "DSN=SchoolSponsor"
NOTIFICATION_EMAIL = "matt@raibledesigns.com"
set Connection = server.createObject("ADODB.Connection")
Connection.open MM_DSN_STRING
%>



Instead of this Line
   schools.ActiveConnection = MM_DSN_STRING

Write

   schools.ActiveConnection = Connection

Then your Code will Work properly.. Provided you haave made DSN i.e SchoolSponsor Properly and tested it ...


Hope this helps.....

Akshay
0
 
LVL 4

Expert Comment

by:vindevogel
Comment Utility
You should open a connection first, like this

set vCN = server.createobject("ADODB.Connection")
vCN.ConnectionString = your_string
vCN.Open

Set vRS = server.createobject("ADODB.Recordset")
vRS.ActiveConnection = vCN
' vCN is a Connection, not a string

Consult the MSDN regarding ADO connections and Recordsets
0
 
LVL 1

Author Comment

by:mraible
Comment Utility
I have a hard time believing that it is not possible to open 2 recordsets at the same time?  If I want to have a "details" page that shows a records details, as well as a drop-down list in that page (populated from the database), I have to have 2 recordsets open at once...
0
 
LVL 4

Expert Comment

by:vindevogel
Comment Utility
You can easily have two recordsets open, even in the same connection.

Your problem is with the connection that is not open.
0
 
LVL 1

Author Comment

by:mraible
Comment Utility
I have a hard time believing that it is not possible to open 2 recordsets at the same time?  If I want to have a "details" page that shows a records details, as well as a drop-down list in that page (populated from the database), I have to have 2 recordsets open at once...
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Author Comment

by:mraible
Comment Utility
I changed my connection.asp (which is an included file) to be:

<%
Dim vCN
MM_DSN_STRING = "DSN=SchoolSponsor"
NOTIFICATION_EMAIL = "matt@raibledesigns.com"
set vCN = server.createObject("ADODB.Connection")
vCN.open MM_DSN_STRING
%>

Now I get:

Provider error '80004005'
Unspecified error

at vCN.open MM_DSN_STRING

??????
0
 
LVL 4

Expert Comment

by:vindevogel
Comment Utility
just type

vCN.ConnectionString = mm_dsn_string
vCN.Open

other question: is there a username/password required ?

0
 
LVL 1

Author Comment

by:mraible
Comment Utility
no username or password,  I get the same unspecified error using the above code.  Is there an easier way to do this - without the connection.asp file included?
0
 
LVL 1

Author Comment

by:mraible
Comment Utility
Is there something I can write to see if any connections are open, and if so, it will close them?
0
 
LVL 4

Expert Comment

by:vindevogel
Comment Utility
vCN.Status = adStateOpen  (returns boolean)
manual close= vCN.Close
0
 
LVL 1

Author Comment

by:mraible
Comment Utility
So I could write something like the following and add it right after I declare an ActiveConnection = vCN:

vCN.Status = adStateOpen  (returns boolean)
If vCN.Status Then
  manual close = vCN.Close
End if

Another question - the current code I have (before I asked this question, and after I've made the changes suggested by everyone on this topic) works GREAT on my local machine.  I have Win2K Professional.  Is it possible that my ISP has a different version of ASP/Access Drivers that is causing all of this to happen.

Also, on my ISP, this application runs SUPER slow, and it flies on my local machine.

Thanks,

Matt
0
 
LVL 4

Expert Comment

by:vindevogel
Comment Utility
No, you can write something like

If vCN.Status = adStatusOpen then
   vCN.Close  'You can manually close a connection with this command, I wanted to say
End If
'However, I don't see the need for you closing the connection

It is possible that your ISP has a different version of about anything ...
Windows version (NT 4 - 2000)
Access version (97 - 2K)
ADO (2.0 - 2.1 - 2.5 - 2.6)
ISAM drivers (Jet 3.5 - 4.0)

Personally, I think the speed problem lies somewhere else, don't ask me where.  Put some "response.write Now()" 's in your code to see where the bottleneck is.
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.  Anytime you have questions which are LOCKED with a Proposed Answer but does not serve your needs, please reject it and add comments as to why.  In addition, when you do grade the question, if the grade is less than an A, please add a comment as to why.  This helps all involved, as well as future persons who may access this item in the future to seek help.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.11540458.html
http://www.experts-exchange.com/questions/Q.11865699.html
http://www.experts-exchange.com/questions/Q.20000151.html
http://www.experts-exchange.com/questions/Q.20028695.html
http://www.experts-exchange.com/questions/Q.20029751.html
http://www.experts-exchange.com/questions/Q.20053487.html
http://www.experts-exchange.com/questions/Q.20088197.html
http://www.experts-exchange.com/questions/Q.20091062.html
http://www.experts-exchange.com/questions/Q.20091566.html
http://www.experts-exchange.com/questions/Q.20094151.html
http://www.experts-exchange.com/questions/Q.20095504.html
http://www.experts-exchange.com/questions/Q.20095562.html
http://www.experts-exchange.com/questions/Q.20096658.html
http://www.experts-exchange.com/questions/Q.20119215.html
http://www.experts-exchange.com/questions/Q.20119942.html
http://www.experts-exchange.com/questions/Q.20119945.html
http://www.experts-exchange.com/questions/Q.20131600.html
http://www.experts-exchange.com/questions/Q.20169403.html
http://www.experts-exchange.com/questions/Q.20191303.html
http://www.experts-exchange.com/questions/Q.20257801.html
http://www.experts-exchange.com/questions/Q.20260879.html
http://www.experts-exchange.com/questions/Q.20258382.html
http://www.experts-exchange.com/questions/Q.20267560.html
http://www.experts-exchange.com/questions/Q.20274260.html
http://www.experts-exchange.com/questions/Q.20273649.html
http://www.experts-exchange.com/questions/Q.20276750.html
http://www.experts-exchange.com/questions/Q.20257799.html


To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.11902618.html

PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643

Moderators will finalize this question if still open in 7 days, by either moving this to the PAQ (Previously Asked Questions) at zero points, deleting it or awarding expert(s) when recommendations are made, or an independent determination can be made.  Expert input is always appreciated to determine the fair outcome.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
0
 
LVL 1

Author Comment

by:mraible
Comment Utility
Turns out it was a permission problem, no write permissions on the folder containing the mdb file.  Moving the site to a Windows 2000 box fixed the performance problem.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now