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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft VBScript compilation error '800a0400'

Status
Not open for further replies.

hutch80

Technical User
Feb 4, 2005
6
0
0
CA
Hi, I'm trying to develop a company intranet using iis and asp. When I try to view my page, I get the following error:

----

Microsoft VBScript compilation error '800a0400'

Expected statement

/iisHelp/common/500-100.asp, line 356

& Server.URLEncode(objASPError.Category) & _ "&os=&over=&hrd=&Opt1=" & Server.URLEncode(objASPError.ASPCode) & "&Opt2=" & Server.URLEncode(objASPError.Number) & _ "&Opt3=" & Server.URLEncode(objASPError.Description)
^

Provider error '80004005'

Unspecified error

/Intranet/login.asp, line 8

----

Line 8 in login.asp is:

rsLogin.ActiveConnection = MM_hacheys_STRING

Thanks, any help is appreciated!

 
here's the code for login.asp:

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/hacheys.asp" -->
<%
Dim rsLogin
Dim rsLogin_numRows

Set rsLogin = Server.CreateObject("ADODB.Recordset")
rsLogin.ActiveConnection = MM_hacheys_STRING
rsLogin.Source = "SELECT * FROM tblUsers"
rsLogin.CursorType = 0
rsLogin.CursorLocation = 2
rsLogin.LockType = 1
rsLogin.Open()

rsLogin_numRows = 0
%>
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("fldUser"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="admin/home.htm"
MM_redirectLoginFailed="login_failed.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_hacheys_STRING
MM_rsUser.Source = "SELECT fldUser, fldPass"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM tblUsers WHERE fldUser='" & Replace(MM_valUsername,"'","''") &"' AND fldPass='" & Replace(Request.Form("fldPass"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
<head>
<title>Hachey Impression - Administrative Site</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="admin/css/hachey.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" cellpadding="0" cellspacing="0">

<tr>


<td><a href="#"><img src="admin/images/logo.jpg" alt="Hachey Impression" border="0"></a></td>

</tr>

<tr>

<td bgcolor="#990000" height="10"></td>

</tr>

<tr>

<td>

<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">

<tr>

<td width="15%" valign="top">&nbsp;</td>

<td align="center">

<div id="tbl_content">


<form name="frmLogin" method="POST" action="<%=MM_LoginAction%>">
<table border="0" align="center" cellpadding="5" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td colspan="2" bgcolor="DCE5EE"> <strong>Login</strong> </td>
</tr>
<tr>
<td width="30%"><div align="right">User</div></td>
<td> <input name="fldUser" type="text" id="fldUser" size="35">
</td>
</tr>
<tr>
<td><div align="right">Password</div></td>
<td> <input name="fldPass" type="password" id="fldPass" size="35">
</td>
</tr>
<tr>
<td><div align="right"></div></td>
<td><a href="admin/pass.htm">Forgot your password?</a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td> <input type="submit" name="Submit" value="Login"> </td>
</tr>
</table>
</form>
</div>

<div id="tbl_content">
<table border="0" align="center" cellpadding="5" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td width="30" colspan="2" bgcolor="DCE5EE"> <strong>Others</strong>
</td>
</tr>
<tr>
<td width="50" height="53"><div align="left"><a href="#"><img src="admin/images/webmail.jpg" width="50" height="42" border="0"></a></div></td>
<td><div align="left"><a href=" class="a_menu">Login
to your webmail account</a></div></td>
</tr>
</table>
</div>


</td>

<td width="20%" valign="top">&nbsp;</td>

</tr>

<tr bordercolor="#FFFFFF">


<td colspan="3" bgcolor="#990000">&nbsp;</td>

</tr>

</table>

</td>

</tr>

</table>


</body>
</html>

<%
rsLogin.Close()
Set rsLogin = Nothing
%>

----

Here's the code for 500-100.asp

---

<%@ language="VBScript" %>

<% Option Explicit



Const lngMaxFormBytes = 200



Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP
Dim strMethod, lngPos, datNow, strQueryString, strURL



If Response.Buffer Then
Response.Clear Response.Status = "500 Erreur interne du serveur"
Response.ContentType = "text/html"
Response.Expires = 0
End If



Set objASPError = Server.GetLastError %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">



<html dir=ltr>



<head>

<style>

a:link {font:8pt/11pt verdana; color:FF0000}

a:visited {font:8pt/11pt verdana; color:#4e4e4e}

</style>



<META NAME="ROBOTS" CONTENT="NOINDEX">



<title>La page ne peut pas être affichée</title>



<META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">

</head>



<script>

function Homepage(){

<!--

// in real bits, urls get returned to our script like this:

// res://shdocvw.dll/http_404.htm#


//For testing use DocURL = "res://shdocvw.dll/http_404.htm#
DocURL=document.URL;



//this is where the http or https will be, as found by searching for :// but skipping the res://

protocolIndex=DocURL.indexOf("://",4);



//this finds the ending slash for the domain server

serverIndex=DocURL.indexOf("/",protocolIndex + 3);



//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining

//of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.

//urlresult=DocURL.substring(protocolIndex - 4,serverIndex);

BeginURL=DocURL.indexOf("#",1) + 1;

urlresult=DocURL.substring(BeginURL,serverIndex);



//for display, we need to skip after and go to the next slash

displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);

InsertElementAnchor(urlresult, displayresult);

}


function HtmlEncode(text)
{
return text.replace(/&/g, '&amp').replace(/'/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}

function TagAttrib(name, value)
{
return ' '+name+'="'+HtmlEncode(value)+'"';
}

function PrintTag(tagName, needCloseTag, attrib, inner){
document.write( '<' + tagName + attrib + '>' + HtmlEncode(inner) );
if (needCloseTag) document.write( '</' + tagName +'>' );
}

function URI(href)
{
IEVer = window.navigator.appVersion;
IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );

return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?
encodeURI(href) :
escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');
}

function InsertElementAnchor(href, text)
{
PrintTag('A', true, TagAttrib('HREF', URI(href)), text);
}

//-->

</script>



<body bgcolor="FFFFFF">



<table width="410" cellpadding="3" cellspacing="5">



<tr>

<td align="left" valign="middle" width="360">

<h1 style="COLOR:000000; FONT: 13pt/15pt verdana"><!--Problem-->La page ne peut pas être affichée</h1>

</td>

</tr>



<tr>

<td width="400" colspan="2">

<font style="COLOR:000000; FONT: 8pt/11pt verdana">Un problème affecte la page que vous essayez d'obtenir et elle ne peut pas être affichée.</font></td>

</tr>



<tr>

<td width="400" colspan="2">

<font style="COLOR:000000; FONT: 8pt/11pt verdana">



<hr color="#C0C0C0" noshade>



<p>Essayez les opérations suivantes :</p>



<ul>

<li id="instructionsText1">Cliquez sur le bouton <a href="javascript:location.reload()">Actualiser</a> ou réessayez plus tard.

</li>



<li>Ouvrez la



<script>

<!--

if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))

{

Homepage();

}

//-->

</script>



page d'accueil, puis recherchez les liens vers les informations souhaitées. </li>

</ul>



<h2 style="font:8pt/11pt verdana; color:000000">HTTP 500,100 – Erreur interne au serveur – Erreur ASP <br> Services Internet (IIS)</h2>



<hr color="#C0C0C0" noshade>



<p>Informations techniques (destinées au personnel du Support technique)</p>



<ul>

<li><strong>Type d'erreur :<br>

<% Dim bakCodepage
on error resume next
bakCodepage = Session.Codepage
Session.Codepage = 1252
on error goto 0
Response.Write Server.HTMLEncode(objASPError.Category)
If objASPError.ASPCode > "" Then
Response.Write Server.HTMLEncode(", " & objASPError.ASPCode)
Response.Write Server.HTMLEncode(" (0x" & Hex(objASPError.Number) & ")" ) & "<br>"

If objASPError.ASPDescription > "" Then
Response.Write objASPError.ASPDescription & "<br>"



If objASPError.ASPDescription > "" Then
Response.Write objASPError.ASPDescription & "<br>"







blnErrorWritten = False



' Only show the Source if it is available and the request is from the same machine as IIS If objASPError.Source > "" Then strServername = LCase(Request.ServerVariables("SERVER_NAME")) strServerIP = Request.ServerVariables("LOCAL_ADDR") strRemoteIP = Request.ServerVariables("REMOTE_ADDR") If (strServername = "localhost" Or strServerIP = strRemoteIP) And objASPError.File <> "?" Then Response.Write Server.HTMLEncode(objASPError.File) If objASPError.Line > 0 Then Response.Write ", line " & objASPError.Line If objASPError.Column > 0 Then Response.Write ", column " & objASPError.Column Response.Write "<br>" Response.Write "<font style=""COLOR:000000; FONT: 8pt/11pt courier new""><b>" Response.Write Server.HTMLEncode(objASPError.Source) & "<br>" If objASPError.Column > 0 Then Response.Write String((objASPError.Column - 1), "-") & "^<br>" Response.Write "</b></font>" blnErrorWritten = True End If End If



If Not blnErrorWritten And objASPError.File <> "?" Then
Response.Write "<b>" & Server.HTMLEncode( objASPError.File)
If objASPError.Line > 0 Then
Response.Write Server.HTMLEncode(", line " & objASPError.Line)
If objASPError.Column > 0 Then
Response.Write ", column " & objASPError.Column
Response.Write "</b><br>"
End If %>

</li>

<p>

<li>Type de navigateur :<br> <%= Request.ServerVariables("HTTP_USER_AGENT") %>

</li>

<p>

<li>Page :<br> <% strMethod = Request.ServerVariables("REQUEST_METHOD")



Response.Write strMethod & " "



If strMethod = "POST" Then Response.Write Request.TotalBytes & " octets à " End If



Response.Write Request.ServerVariables("SCRIPT_NAME")



lngPos = InStr(Request.QueryString, "|")



If lngPos > 1 Then Response.Write "?" & Left(Request.QueryString, (lngPos - 1)) End If



Response.Write "</li>"



If strMethod = "POST" Then
Response.Write "<p><li>POST Data:<br>"
If Request.TotalBytes > lngMaxFormBytes Then
Response.Write Server.HTMLEncode(Left(Request.Form, lngMaxFormBytes)) & " . . ."
Else Response.Write Server.HTMLEncode(Request.Form)
End If
Response.Write "</li>"
End If



%>

<p>

<li>Heure :<br> <% datNow = Now()



Response.Write Server.HTMLEncode(FormatDateTime(datNow, 1) & ", " & FormatDateTime(datNow, 3))
on error resume next
Session.Codepage = bakCodepage
on error goto 0 %>

</li>

</p>

<p>

<li>Plus d'informations :<br>
<% strQueryString = "prd=iis&sbp=&pver=5.0&ID=500;100&cat="
& Server.URLEncode(objASPError.Category) & _ "&os=&over=&hrd=&Opt1=" & Server.URLEncode(objASPError.ASPCode) & "&Opt2=" & Server.URLEncode(objASPError.Number) & _ "&Opt3=" & Server.URLEncode(objASPError.Description)
strURL = " & strQueryString
%>
<a href="<%= strURL %>">Support technique Microsoft</a>
</li>

</p>



</font></td>

</tr>



</table>

</body>

</html>
 
try this for your 500-100.asp

Code:
<%@ language="VBScript" %>

<% 
Option Explicit



  Const lngMaxFormBytes = 200



  Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP
  Dim strMethod, lngPos, datNow, strQueryString, strURL



  If Response.Buffer Then
  Response.Clear 
  Response.Status = "500 Erreur interne du serveur"
  Response.ContentType = "text/html"
  Response.Expires = 0
  End If



  Set objASPError = Server.GetLastError %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">



<html dir=ltr>



<head>

<style>

a:link            {font:8pt/11pt verdana; color:FF0000}

a:visited        {font:8pt/11pt verdana; color:#4e4e4e}

</style>



<META NAME="ROBOTS" CONTENT="NOINDEX">



<title>La page ne peut pas être affichée</title>



<META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">

</head>



<script>

function Homepage(){

<!--

// in real bits, urls get returned to our script like this:

// res://shdocvw.dll/http_404.htm#[URL unfurl="true"]http://www.DocURL.com/bar.htm[/URL]



    //For testing use DocURL = "res://shdocvw.dll/http_404.htm#[URL unfurl="true"]https://www.microsoft.com/bar.htm"[/URL]

    DocURL=document.URL;

    

    //this is where the http or https will be, as found by searching for :// but skipping the res://

    protocolIndex=DocURL.indexOf("://",4);

    

    //this finds the ending slash for the domain server

    serverIndex=DocURL.indexOf("/",protocolIndex + 3);



    //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining

    //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.

    //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);

    BeginURL=DocURL.indexOf("#",1) + 1;

    urlresult=DocURL.substring(BeginURL,serverIndex);

        

    //for display, we need to skip after [URL unfurl="true"]http://,[/URL] and go to the next slash

    displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);

    InsertElementAnchor(urlresult, displayresult);

}


function HtmlEncode(text)
{
    return text.replace(/&/g, '&amp').replace(/'/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}

function TagAttrib(name, value)
{
    return ' '+name+'="'+HtmlEncode(value)+'"';
}

function PrintTag(tagName, needCloseTag, attrib, inner){
    document.write( '<' + tagName + attrib + '>' + HtmlEncode(inner) );
    if (needCloseTag) document.write( '</' + tagName +'>' );
}

function URI(href)
{
    IEVer = window.navigator.appVersion;
    IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );

    return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?
        encodeURI(href) :
        escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');
}

function InsertElementAnchor(href, text)
{
    PrintTag('A', true, TagAttrib('HREF', URI(href)), text);
}

//-->

</script>



<body bgcolor="FFFFFF">



<table width="410" cellpadding="3" cellspacing="5">



  <tr>    

    <td align="left" valign="middle" width="360">

    <h1 style="COLOR:000000; FONT: 13pt/15pt verdana"><!--Problem-->La page ne peut pas être affichée</h1>

    </td>

  </tr>

  

  <tr>

    <td width="400" colspan="2">

    <font style="COLOR:000000; FONT: 8pt/11pt verdana">Un problème affecte la page que vous essayez d'obtenir et elle ne peut pas être affichée.</font></td>

  </tr>

  

  <tr>

    <td width="400" colspan="2">

    <font style="COLOR:000000; FONT: 8pt/11pt verdana">



    <hr color="#C0C0C0" noshade>

    

    <p>Essayez les opérations suivantes :</p>



    <ul>

      <li id="instructionsText1">Cliquez sur le bouton <a href="javascript:location.reload()">Actualiser</a> ou réessayez plus tard.

      </li>

      

      <li>Ouvrez la

      

      <script>

      <!--

      if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))

      {

           Homepage();

      }

      //-->

      </script>



      page d'accueil, puis recherchez les liens vers les informations souhaitées. </li>

    </ul>

    

    <h2 style="font:8pt/11pt verdana; color:000000">HTTP 500,100 – Erreur interne au serveur – Erreur ASP <br> Services Internet (IIS)</h2>



    <hr color="#C0C0C0" noshade>

    

    <p>Informations techniques (destinées au personnel du Support technique)</p>



<ul>

<li><strong>Type d'erreur :<br>

<% 
Dim bakCodepage
on error resume next
bakCodepage = Session.Codepage
Session.Codepage = 1252
on error goto 0
Response.Write Server.HTMLEncode(objASPError.Category)
If objASPError.ASPCode > "" Then
Response.Write Server.HTMLEncode(", " & objASPError.ASPCode)
Response.Write Server.HTMLEncode(" (0x" & Hex(objASPError.Number) & ")" ) & "<br>"
end if
If objASPError.ASPDescription > "" Then
Response.Write objASPError.ASPDescription & "<br>"
end if


  If objASPError.ASPDescription > "" Then
  Response.Write objASPError.ASPDescription & "<br>"
  end if






  blnErrorWritten = False



  ' Only show the Source if it is available and the request is from the same machine as IIS If objASPError.Source > "" Then strServername = LCase(Request.ServerVariables("SERVER_NAME")) strServerIP = Request.ServerVariables("LOCAL_ADDR") strRemoteIP =  Request.ServerVariables("REMOTE_ADDR") If (strServername = "localhost" Or strServerIP = strRemoteIP) And objASPError.File <> "?" Then Response.Write Server.HTMLEncode(objASPError.File) If objASPError.Line > 0 Then Response.Write ", line " & objASPError.Line If objASPError.Column > 0 Then Response.Write ", column " & objASPError.Column Response.Write "<br>" Response.Write "<font style=""COLOR:000000; FONT: 8pt/11pt courier new""><b>" Response.Write Server.HTMLEncode(objASPError.Source) & "<br>" If objASPError.Column > 0 Then Response.Write String((objASPError.Column - 1), "-") & "^<br>" Response.Write "</b></font>" blnErrorWritten = True End If End If



  If Not blnErrorWritten And objASPError.File <> "?" Then
  Response.Write "<b>" & Server.HTMLEncode(  objASPError.File)
  end if
  If objASPError.Line > 0 Then
  Response.Write Server.HTMLEncode(", line " & objASPError.Line)
  end if
  If objASPError.Column > 0 Then
  Response.Write ", column " & objASPError.Column
  Response.Write "</b><br>"
  End If %>

</li>

<p>

<li>Type de navigateur :<br> <%= Request.ServerVariables("HTTP_USER_AGENT") %>

</li>

<p>

<li>Page :<br> <% strMethod = Request.ServerVariables("REQUEST_METHOD")



  Response.Write strMethod & " "



  If strMethod = "POST" Then Response.Write Request.TotalBytes & " octets à " End If



  Response.Write Request.ServerVariables("SCRIPT_NAME")



  lngPos = InStr(Request.QueryString, "|")



  If lngPos > 1 Then Response.Write "?" & Left(Request.QueryString, (lngPos - 1)) End If



  Response.Write "</li>"



  If strMethod = "POST" Then
  Response.Write "<p><li>POST Data:<br>"
  If Request.TotalBytes > lngMaxFormBytes Then
  Response.Write Server.HTMLEncode(Left(Request.Form, lngMaxFormBytes)) & " . . ."
  Else Response.Write Server.HTMLEncode(Request.Form)
  End If
  Response.Write "</li>"
  End If



%>

<p>

<li>Heure :<br> <% datNow = Now()



  Response.Write Server.HTMLEncode(FormatDateTime(datNow, 1) & ", " & FormatDateTime(datNow, 3))
  on error resume next
  Session.Codepage = bakCodepage
  on error goto 0 %>

</li>

</p>

<p>

<li>Plus d'informations :<br>
<%  
strQueryString = "prd=iis&sbp=&pver=5.0&ID=500;100&cat=" & Server.URLEncode(objASPError.Category) & _ 
"&os=&over=&hrd=&Opt1=" & Server.URLEncode(objASPError.ASPCode)  & _
"&Opt2=" & Server.URLEncode(objASPError.Number) & _ 
"&Opt3=" & Server.URLEncode(objASPError.Description)
strURL = "[URL unfurl="true"]http://www.microsoft.com/ContentRedirect.asp?"[/URL] & strQueryString

%>
<a href="<%= strURL %>">Support technique Microsoft</a>
</li>

</p>



    </font></td>

  </tr>

  

</table>

</body>

</html>
 
you were missing a couple of "end if"'s and "&_" was being misused
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top