Solved

ASP Error 0x80004005 Unspecified error when using ADODB.RecordSet

Posted on 2004-04-26
14
2,452 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
  • 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
 
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
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 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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

16 Experts available now in Live!

Get 1:1 Help Now