View Full Version : getting (0x80004005) error - help!!!
gcapp
05-26-2009, 10:52 PM
Can someone please help???
I have used this exact code on another page on my website (except for the different object names) and I get a (0x80004005) error. It states nothing other than (0x80004005). I have read up on this error and still can't get it to work. Can someone please tell me what to do???
<%
dim rsPointResult
dim sqlPointResult
DSN = "provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("/database/ccflvs2.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open DSN
set rsPointResult = server.CreateObject("adodb.recordset") 'create object for recordset
sqlPointResult="SELECT Points.ID, Points.Race_Date, Points.Race, Points.Position, Points.Car_Number, Points.Driver, Points.TotalPoints FROM Points WHERE Points.Race LIKE '" & Request.Form("racepoints") & "%' ORDER BY Points.Position asc"
set rsPointResult = Conn.Execute(sqlPointResult)
if rsPointResult.EOF=true then
response.write("<font color='red'><b>No point standings found.</b></font><br><br>")
response.write("<font color='red'>Start over and modify the searchcriteria </font>")
else
Response.Write ("<b><u><font color='#000000'>" & Request.Form("racepoints") & " Point Standings as of " & rsPointResult("Race_Date") & "</font></u></b><br>")
Response.Write ("<br><table border=1 cellspacing=1 width=350 class='smalltext'>")
Response.write("<tr valign=top bgcolor=#FFFFCC>")
Response.write("<td align=center><B>" & "Position" & "</B></td>")
Response.write("<td align=center><B>" & "Car Number" & "</B></td>")
Response.write("<td align=center><B>" & "Driver" & "</B></td>")
Response.write("<td align=center><B>" & "Points" & "</B></td></tr>")
do while rsPointResult.EOF=false
Response.write("<tr valign=top><td align=center>" & rsPointResult.Fields("Position") & "</td>")
Response.write("<td align=center>" & rsPointResult.Fields("Car_Number") & "</td>")
Response.write("<td align=center>" & rsPointResult.Fields("Driver") & "</td>")
Response.write("<td align=center>" & rsPointResult.Fields("TotalPoints") & "</td></tr>")
response.write ("</td>")
response.write ("</tr>")
rsPointResult.Movenext
loop
response.write ("</table>")
rsPointResult.close
set rsPointResult=nothing
end if
%>
Old Pedant
05-26-2009, 11:18 PM
What *LINE* are you getting that from?
Unfortunately, that is a "generic" error number that doesn't tell the real cause of the error.
If you are using MSIE, have you "fixed" your browser? To wit:
-- Click on TOOLS menu
-- Click on INTERNET OPTIONS menu item
-- Click on ADVANCED tab
-- *UN*check "show friendly HTTP error messages"
-- OK
See if you now get a better error message.
Old Pedant
05-26-2009, 11:21 PM
And did you debug?
....
sqlPointResult="SELECT ID, Race_Date, Race, Position, Car_Number, Driver, TotalPoints " _
& " FROM Points " _
& " WHERE Race LIKE '" & Request.Form("racepoints") & "%' " _
& " ORDER BY Position asc"
Response.Write "DEBUG SQL: " & sqlPointResult & "<HR>"
...
(You never need to use the name of the table more than in the FROM clause if there is only one table in use. Doesn't hurt to code as you did, but no need for it.)
gcapp
05-26-2009, 11:34 PM
The line in which I get the error is this line:
set rsPointResult = Conn.Execute(sqlPointResult)
I also did both things you suggested and once again the (0x80004005) error showed, but it did give me the line above as the error.
Any suggestions?
Old Pedant
05-27-2009, 12:12 AM
So it's probably an error in your SQL.
What did the DEBUG output show you? That is, the Response.Write of the query??
By the way, not your fault re the generic error; it's just the silly OLE DB driver that isn't handling all possible internal errors. Didn't mean to imply error was yours if you took it that way.
gcapp
05-27-2009, 10:41 AM
I put your code on but it did not produce anything - just the error page.
Any other thoughts?
new_comer
05-27-2009, 02:47 PM
Howdy,
I did come across something through the net which I hope in some way useful!
"" Occasionally, I run into Error 0x80004005 when registering these files. This error sounds highly complicated, but what it all boils down to is a rights issue. This error basically means that you don’t have the permissions to register the file you are trying to register.
This usually brings about the questions, “Wait! I’m logged in as an administrator?!”
Under previous versions of Windows, being logged in as an administrator is enough, but in Windows Vista there is a little thing called User Account Control (UAC) that prevents programs from running administrative tasks without first specifying that they are running as the administrator. This applies for the command prompt the same as it does for any other program. This being the case, right-click on the command prompt icon, and select “Run as Administrator”, and then try to register your DLL. This is a mistake that is usually frustrating enough that, once you figure it out, you won’t make too often.""
http://www.windowsnetworking.com/kbase/WindowsTips/WindowsVista/AdminTips/ApplicationCompatibility/TroubleshootingRegsvr32Error0x80004005.html
Old Pedant
05-27-2009, 08:27 PM
Hmmm...your server might have custom 500 error handling.
Okay, put in a Response.End just after the Response.Write debug. Just temporary, so we can see the debug output.
new_comer: All you write is true, but he says this same code has worked on other pages on the site. And since this is using the JET driver, all pages would have the same "authority" since there's only one JET driver per server. Not impossible that it's a permission issue, but just a lot less likely given the driver in use.
gcapp
05-27-2009, 10:48 PM
Thanks for your advice Old Pendant. I put in the code once again and it still will generate nothing but the line error.
If you have a second you can check it out at:
www.littlevalleyspeedway.com/point_standings.asp
Choose any of the race classes from the drop-down and hit submit and you will see what I get.
Maybe you will see something different??
Old Pedant
05-28-2009, 04:59 AM
Yeah, as I guessed, your site has a custom 500.100 Error handler. So it hides the real problems, unfortunately.
But putting in a RESPONSE.END *just before line 44* should stop the error so that we can see what is really happening.
Another option, one I don't often advise, but since somebody decided to put in that custom error handler we don't have much choice. Try this code:
<%
... code above here unchanged ...
dim rsPointResult
dim sqlPointResult
DSN = "provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("/database/ccflvs2.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open DSN
On Error Resume Next
set rsPointResult = server.CreateObject("adodb.recordset") 'create object for recordset
Response.Write "After creating recordset, Err.Number is " & Err.Number & "<HR>"
Response.Write "TypeName(rsPointResult) is " & TypeName(rsPointResult) & "<HR>"
sqlPointResult="SELECT * FROM Points " _
& " WHERE Race LIKE '" & Request.Form("racepoints") & "%' " _
& " ORDER BY Points.Position asc"
Response.Write "SQL: " & sqlPointResults & "<HR>"
set rsPointResult = Conn.Execute(sqlPointResult)
Response.Write "After executing SQL, Err.Number is " & Err.Number & "<HR>"
Response.Write "After executing SQL, Err.Description is " & Err.Description & "<HR>"
Response.End
... rest of page won't matter ...
And what does *THAT* show you ??
gcapp
05-28-2009, 10:44 AM
i put your code in and this is what is gave me:
After creating recordset, Err.Number is 0
TypeName(rsPointResult) is Recordset
DEBUG SQL: SELECT * FROM Points WHERE Points.Race LIKE 'E-Mods%' ORDER BY Points.Position asc
After executing SQL, Err.Number is -2147467259
After executing SQL, Err.Description is
hope this helps
Old Pedant
05-28-2009, 09:24 PM
Nope, doesn't help at all.
Was hoping for something else. *sigh* Sorry.
You should go try that same query in Access, without ASP/ADO getting in the way. But I'd bet it works there just fine.
Not sure what to suggest next.
I dunno why I didn't notice this yesterday, but your code line that is doing
set rsPointResult = server.CreateObject("adodb.recordset")
is useless. When you the do the line
set rsPointResult = Conn.Execute(sqlPointResult)
that *throws away* the object your use CreateObject to get and creates a brand new one.
That does suggest that you try two more things:
(1) Get rid of the CreateObject("ADODB.Recordset") line.
Don't expect that to matter, but...
(2) Keep that line, but replace the "conn.Execute" line with this:
rsPointResult.Open sqlPointResult, conn
(3) Really grasping at straws now: What happens if you change sqlPointResult to just
sqlPointResult = "SELECT * FROM Points"
??
gcapp
05-31-2009, 12:24 PM
Well I did everything you suggested and nothing works. I even made a new page, gave the table in my database a new name, used a little bit different coding and still the same.
If you have any solutions to this - I would really appreciate an answer.
I'm going to try and dig further to find out how I may solve this.
thanks
Old Pedant
05-31-2009, 08:06 PM
One last question: You say this coding works on other pages (as I expect it should).
Are those other pages connecting to the same database???
I had forgotten that I have gotten an error when I had a corrupted ".mdb" file. When I did a "Compact and repair" on the db, then it started working again. But I don't remember whether it was this error or a different one.
gcapp
05-31-2009, 10:08 PM
Yes the pages that work and the one that doesn't is connecting to the same database. I did a Compact and Repair, but the same error occurs.
Any other ideas?
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.