Solved

ASP Error 0x80004005 Unspecified error when using ADODB.RecordSet

Posted on 2004-04-26
14
2,483 Views
Last Modified: 2012-08-14
I have an ASP Page using this code:
--begin
          Dim rs
            Set rs = Server.CreateObject("ADODB.RecordSet")
      Dim sql
          Dim conn
          Dim h
          h = 20
            conn="PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=\\data\warehouse\db\Weather.mdb"
               
          sql = "SELECT [Code], [Temp], [FLike], [Cond], [Icon], [City], [Sort] FROM [tblWeather] ORDER BY [Sort]"
          
            rs.Open sql, conn, 1, 3

-end

IIS Is returning this error:
0x80004005 Unspecified error

Both the data server and the IIS server are part of the same domain. The user running the ASP pages in IIS has access to the mdb file.  The mdb file is not currently locked (no ldb).  There is no one in the database.

The only way I can get this to work is to have an Administrator run the page.  I have restarted the server, triple checked the database, everything!

Do any of you have any help?

Travis
0
Comment
Question by:wtconway
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 4
14 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 10919625
try change
    conn="PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=\\data\warehouse\db\Weather.mdb"
to
    conn.open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=\\data\warehouse\db\Weather.mdb"


hongjun
0
 
LVL 33

Expert Comment

by:hongjun
ID: 10919638
also before the .open method, do this

set conn = server.createobject("ADODB.Connection")
0
 
LVL 10

Expert Comment

by:Shailesh15
ID: 10919679
change the connection .. It may solve..

 conn="Driver={Microsoft Access Driver (*.mdb)};Dbq=\\data\warehouse\db\Weather.mdb;Uid=admin;Pwd="

0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 10

Expert Comment

by:Shailesh15
ID: 10919699
Oops!.. hongjun is right you are missing open statement..

conn.open "Driver={Microsoft Access Driver (*.mdb)};Dbq=\\data\warehouse\db\Weather.mdb;Uid=admin;Pwd="
0
 
LVL 7

Author Comment

by:wtconway
ID: 10920172
I added that and no help.  I am still getting the error.

Any other ideas?  Maybe I should have this moved to the IIS board.
0
 
LVL 33

Expert Comment

by:hongjun
ID: 10920184
what is your latest code?
0
 
LVL 7

Author Comment

by:wtconway
ID: 10920491
         Dim rs
            Set rs = Server.CreateObject("ADODB.RecordSet")
            Dim sql
          Dim conn
          Set conn = Server.CreateObject("ADODB.Connection")
          Dim h
          h = 20
            conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=\\data\warehouse\db\Weather.mdb"
               
          
          sql = "SELECT [Code], [Temp], [FLike], [Cond], [Icon], [City], [Sort] FROM [tblWeather] ORDER BY [Sort]"
          
            rs.Open sql, conn, 1, 3
                                                 ..........................
            rs.Close
            
            %>
            <div style="top: 15px; left: 190px; position:absolute; width: 450px; height: 490px; ">
                  <b><%
                  
                  sql = "SELECT [TimeAdded], [Text], [Visible], [Page] FROM [tblText] WHERE [Visible]=""Y"" AND ([Page]=""ALL"" OR [Page]=""CORP"") ORDER BY [TimeAdded]"
                  
                  rs.Open sql, conn, 1, 3
                        Do While Not rs.EOF
                              Response.Write("<p align=""justify"">")
                              Response.Write(Replace(rs.Fields("Text"), vbCrLf, "<br>"))
                              Response.Write("</p>")
                              rs.MoveNext
                        Loop
                  rs.Close
                  conn.Close
                  %>
0
 
LVL 10

Expert Comment

by:Shailesh15
ID: 10921391
change the connection to ODBC driver .. It may solve..

conn.open "Driver={Microsoft Access Driver (*.mdb)};Dbq=\\data\warehouse\db\Weather.mdb;Uid=admin;Pwd="
0
 
LVL 7

Author Comment

by:wtconway
ID: 10921451
I tried that earlier.  When I do that I get the following error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 3.
/google/index.asp, line 65

Line 65 is:
rs.Open sql, conn, 1, 3

In the code above, it is th second instance where I am opening the recordset.
0
 
LVL 10

Expert Comment

by:Shailesh15
ID: 10921560
change
sql = "SELECT [TimeAdded], [Text], [Visible], [Page] FROM [tblText] WHERE [Visible]='Y' AND ([Page]='ALL' OR [Page]='CORP') ORDER BY [TimeAdded]"
0
 
LVL 7

Author Comment

by:wtconway
ID: 10921637
It didn't work.....

I have tried everything now it seems.   I have gone through many many many online resources.... This isn't the first time we have had problems with this machine!  I am starting to really hate MS.  I think we are gonna just have to format this baby and go on.

Travis
0
 
LVL 10

Accepted Solution

by:
Shailesh15 earned 250 total points
ID: 10921695
Copy that mdb in to the ASP dir & run.. just for debugging.. see.if problem is file/pc/network or just ASP!
0
 
LVL 33

Expert Comment

by:hongjun
ID: 10923835
weird.
your sql statement seems ok.
0
 
LVL 7

Author Comment

by:wtconway
ID: 10932129
You know Shailesh,

I just tried that a second ago and it worked... of course, I dont know if it is because of me restarting the server today, but it worked.

I moved the database to another directory (so that people can't just download the mdb from the directory).

I think it may be because this server used to be a PDC and now has been demoted to a SDC and the PDC doesn't allow the communication from this restricted account to a non-DC server. (The IT guys know what this means).

Thanks Guys.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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