Solved

ASP Error 0x80004005 Unspecified error when using ADODB.RecordSet

Posted on 2004-04-26
14
2,464 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server Web Traffic Limitations 4 67
Microsoft SQL ADO Conn Issue 6 50
Obtaining data on ASP 8 28
IIS components 2 14
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 demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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