Solved

Provider error '80004005' unspecified error

Posted on 2001-08-16
18
1,114 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
ID: 6392341
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
ID: 6392464
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
ID: 6392497
Hi Mraible

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

Akshay
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 1

Author Comment

by:mraible
ID: 6392593
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
ID: 6395703
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
ID: 6396330
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
ID: 6396832
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
ID: 6396869
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
ID: 6396875
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 1

Author Comment

by:mraible
ID: 6396878
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
ID: 6396885
just type

vCN.ConnectionString = mm_dsn_string
vCN.Open

other question: is there a username/password required ?

0
 
LVL 1

Author Comment

by:mraible
ID: 6396953
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
ID: 6396995
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
ID: 6397108
vCN.Status = adStateOpen  (returns boolean)
manual close= vCN.Close
0
 
LVL 1

Author Comment

by:mraible
ID: 6397201
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
ID: 6397437
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
ID: 6874735
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
ID: 6882912
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 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