Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 1st, 2008, 08:46 PM
Registered User
 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft VBScript compilation error '800a03f6'

Hello,

Would someone mind looking over this code and telling me what I'm doing wrong?

I am getting the error:
Microsoft VBScript compilation error '800a03f6'

Expected 'End'

/draft/login.asp, line 127 (line 127 is the last line of code below)


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
' ************************************************** ******************
' Check for enabled cookies by creating a test session variable and
' recalling the login page. If the session variable retains its value
' then your test is successful
' ************************************************** *****************
If Session("Access_Status") = "" _
AND Request.QueryString("test") <> 1 then

Session("Access_Status") = "Test"
Response.Redirect "login.asp?test=1"

ElseIf Session("Access_Status") = "" _
AND Request.QueryString("test") = 1 then

Response.Redirect "cookie_error.asp"

End If %>

<%
' ************************************************** ****************
' Verify User Name and Password. If correct set Session variable =
' to check against on secure pages. Redirect User to the secured
' ************************************************** ****************
If LCase(Trim(Request("UserName"))) = "yyyuser" _
AND lcase(trim(Request("Password"))) = "yyypass" then

Session("Access_Status") = "Granted"
Response.Redirect "http://www.yyy.biz/draft/info.asp"

ElseIf LCase(Trim(Request("UserName"))) = "yyysetup" _
AND LCase(Trim(Request("Password"))) = "yyypass" then

Session("Special_Status") = "SpecialSet"
Response.Redirect "http://www.yyy.biz/draft/specificsetup.asp"

Else If LCase(Trim(Request("UserName"))) = "xxxuser" _
AND lcase(trim(Request("Password"))) = "xxxpass" then

Session("Access_Status") = "Granted"
Response.Redirect "http://www.xxx.biz/draft/info.asp"

ElseIf LCase(Trim(Request("UserName"))) = "xxxsetup" _
AND lcase(trim(Request("Password"))) = "xxxpass" then

Session("Access_Status") = "Special"
Response.Redirect "http://www.xxx.biz/draft/specific.asp"
' ************************************************** *****************
' If not correct User Name and Password and user attempted to enter
' something, change status to Denied. Use this value to know when
' to display an error message.
' ************************************************** *****************
ElseIf Request("UserName") <> "" _
OR Request("Password") <> "" then

Session("Access_Status") = "Denied"

' ************************************************** **************
' Must be an initial view or the User entered nothing. Make sure the
' Access_Status = "" so the page will display without an error message
' ************************************************** ****************
Else

Session("Access_Status") = "Test"

End If
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

</head>
<body >


<%
' ************************************************** ****************
' Display error message when an incorrect User Name or Password is
' ************************************************** ****************
If Session("Access_Status") = "Denied" then
response.write("<p class=""accessdenied"">The Username and#47;or Password you entered were incorrect. Please try again.</p>")
End If %>



Thank you for any help you can offer!

 
Old April 1st, 2008, 09:27 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

To be honest I have never seen a code like this before. Your layout, indenting and general good code practice id very irregular. IMO This is why you are having difficulty finding which condition is not closed. Very hard to follow code this this. EG lets take you first conditional statement layout:

If Session("Access_Status") = "" _
AND Request.QueryString("test") <> 1 then

Session("Access_Status") = "Test"
Response.Redirect "login.asp?test=1"

ElseIf Session("Access_Status") = "" _
AND Request.QueryString("test") = 1 then

Response.Redirect "cookie_error.asp"

End If %>

Most people I know would write it similar to this:

If Session("Access_Status") = "" AND Request.QueryString("test") <> 1 then
   Session("Access_Status") = "Test"
   Response.Redirect "login.asp?test=1"
ElseIf Session("Access_Status") = "" AND Request.QueryString("test") = 1 then
   Response.Redirect "cookie_error.asp"
End If

It just makes it easier to follow. Anyhow I dont mean to sound to suggestive. Everyone has thier own style and I thought to give you my opinion. I wouldnt have a person working for me who did not practice industry standard indenting of some kind.


Wind is your friend
Matt
www.elitemarquees.com.au
 
Old April 1st, 2008, 09:32 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Why are you getting this error. Have a read of this:

http://www.computerperformance.co.uk...e_800A03F6.htm

Wind is your friend
Matt
www.elitemarquees.com.au
 
Old April 2nd, 2008, 01:50 PM
Registered User
 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Both suggestions were very helpful. It's working now. Thank you!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft VBScript compilation error '800a03f6' ksrhyd Classic ASP Professional 0 October 11th, 2007 07:53 AM
Microsoft VBScript compilation error '800a03f6' dondavanzo Access ASP 1 May 30th, 2006 02:11 PM
Microsoft VBScript compilation error '800a0408' tarzannn Classic ASP Professional 2 February 3rd, 2006 08:55 AM
Microsoft VBScript compilation error karlzoe Classic ASP Databases 2 December 29th, 2004 10:44 AM
Microsoft VBScript compilation error '800a03f6' stevesole Access ASP 2 June 8th, 2004 02:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.