Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP error in page not making any sense

Status
Not open for further replies.

tmcneil

Technical User
Nov 17, 2000
294
US
All,

I have constructed an html login page to be used with an online mapping tool with the help of a programmer. Login.htm uses an ASP page called Authenticate.asp to identify the username and password typed into the html page. How does it do this? It opens a recordset, using SQL and compares it against an Access 2000 database with all the valid usernames and passwords. What's the problem you may ask? Well, a successful login is inconsistent. I can login the first time with ease, but if I do a back or refresh the page in IE 6, type in another valid username and password and I get a white page back with:

Error Type:
Provider (0x80004005)
Unspecified error
/website/authenticate.asp, line 47

I've gone through the Microsoft support site and this error type is not documented. This error even occurs when I type in a wrong username and password. Here is the code, html with asp embedded for all to look at and see if there is something that might be hanging it up.

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<html>
<head>
<link rel=stylesheet href=&quot;styles/dialog.css&quot; type=&quot;text/css&quot;>
<title>Authenticate</title>
</head>
<body background=&quot;images/backgrnd.gif&quot;>
<center>
<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=&quot;90%%&quot;>
<tr>
<td VALIGN=TOP ALIGN=LEFT width=&quot;30%%&quot;><img src=&quot;images/aar_logo_large.gif&quot;></td>
<td VALIGN=BOTTOM ALIGN=CENTER><p align=&quot;center&quot;>
<font SIZE=5 COLOR=&quot;#000080&quot; face=&quot;Times New Roman&quot;><b>AAR Ribbon License</b></font></td>
<td VALIGN=TOP ALIGN=RIGHT width=&quot;30%%&quot;><img src=&quot;images/small_ttci_logo.gif&quot;></td>
</tr>
</table>
<img src=&quot;images/space.gif&quot; width=&quot;500&quot; height=&quot;100&quot;>
<%
username = &quot;&quot;
password = &quot;&quot;
if Not IsEmpty(Request.Form(&quot;username&quot;)) then username = Request.Form(&quot;username&quot;)
if Not IsEmpty(Request.Form(&quot;password&quot;)) then password = Request.Form(&quot;password&quot;)
%>

<%
Set cn = Server.CreateObject(&quot;ADODB.Connection&quot;)
cn.ConnectionTimeout = 15
cn.CommandTimeout = 30

cn.Open &quot;DSN=AAR;DATABASE=aar;APP=ASP script&quot;

Set SQLStmt = Server.CreateObject(&quot;ADODB.Command&quot;)
Set RS = Server.CreateObject(&quot;ADODB.Recordset&quot;)

SQLStmt.CommandText = &quot;select * from users &quot; & _
&quot;where username='&quot; & CStr(username) & &quot;' and &quot; & _
&quot; password='&quot; & CStr(password) & &quot;'&quot;
SQLStmt.CommandType = 1
Set SQLStmt.ActiveConnection = cn
RS.Open SQLStmt

if Not RS.EOF then %>
<%=RS(&quot;username&quot;)%> exists!
<% else %>
<form action=&quot;login.htm&quot; method=&quot;get&quot;>
<table border=&quot;0&quot; width=&quot;400&quot; class=&quot;dlgframe&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; bgcolor=&quot;#C0C0C0&quot;>
<tr class=&quot;dlgcaption&quot;><td colspan=&quot;4&quot;> Invalid Login</td></tr>
<tr><td rowspan=&quot;8&quot; width=&quot;4&quot;> </td>
<td colspan=2><img src=&quot;images/space.gif&quot; height=&quot;8&quot; width=&quot;1&quot;></td>
<td rowspan=&quot;8&quot; width=&quot;4&quot;> </td>
</tr>
<tr>
<td align=&quot;left&quot; rowspan=3 valign=&quot;top&quot; width=&quot;40&quot;><img src=&quot;images/iexclam.gif&quot;></td>
<td align=&quot;left&quot; class=&quot;dlglabel&quot;>The username &quot;<%=username%>&quot; doesn't
exist in the AAR Ribbon license system or you gave an incorrect password!</td>
</tr>
<tr><td colspan=&quot;2&quot; height=4><img src=&quot;images/space.gif&quot; width=&quot;1&quot; height=&quot;15&quot;></tr>
<tr>
<td align=&quot;left&quot; class=&quot;dlglabel&quot;>You must enter a valid username and password!</td>
</tr>
<tr><td colspan=&quot;2&quot; height=4><img src=&quot;images/space.gif&quot; width=&quot;1&quot; height=&quot;5&quot;></td>
</tr>
<tr>
<td colspan=2 align=&quot;center&quot;>
<input type=&quot;submit&quot; name=&quot;SUBMIT&quot; value=&quot;OK&quot; style=&quot;width: 80;&quot;>
</td>
</tr>
<tr><td colspan=&quot;2&quot; height=&quot;4&quot;></td></tr>
</table>
</form>
<% end if %>
<%
cn.Close
Set cn = Nothing
%>
</table>

<table border=&quot;0&quot; width=&quot;598&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr><td><img src=&quot;images/space.gif&quot; height=&quot;200&quot;></td></tr>
<tr><td align=&quot;center&quot;><font size=2 face=&quot;Times Roman&quot;><i>
© 2002 ARINC Incorporated. All rights reserved.
</i></font>
</td>
</tr>
</table>
<center>
<p></p>
</body>
</html>
 
What is line 47? Sorry, I count lines but I don't see anything there. :)
 
This line:

cn.Open &quot;DSN=AAR;DATABASE=aar;APP=ASP script&quot;
 
hmmm, sorry, I don't know what can be generating that error.... the code looks fine to me.
 
I'm not sure either, but I used a valid username and password like, tmcneil for both, and it works fine. If I do a back and try another valid username and password, I get that error. its very weird. Might it have something to do with the ConnectionTimeout and CommandTimeout functions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top