Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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 January 2nd, 2010, 07:59 AM
Registered User
 
Join Date: Jan 2010
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Expected 'End' / Loop Headache

Hi All,

Im starting to learn ASP as I had some ASP scripts coded for me and after some use they need updated and modified slightly and the original coder can no longer help with them so i decided to learn myself.

The issue im running into at the moment has to do with user activations. When a user signs up on the site they get sent an activation code via email which they will then have to enter on the site to activate their account.

Within the Admin panel there is a option to activate the account for the user. When i try to activate any accounts i get the following error
Quote:
Microsoft VBScript compilation error '800a03f6'

Expected 'End'

/aa3/administration/Activate_Accounts.asp, line 47
I have checked my IF / End IF statements and they look correct to me, Ive looked around the INet but am still unable to work out whats wrong.

The portion of code in question is below; any help would be greatly appreciated.

Code:
<!-- #Include File='../includes/inc_includes.asp' -->
<!-- #Include File='includes/level3.asp'-->

<%
Set dbcon=DBConnect(DB_MAIN)
	rSQL = "SELECT AccountID, Username, Email FROM Members WHERE Activated = FALSE ORDER BY AccountID ASC"
	Set oRs=DBRecordSet(dbcon, rSQL)
		If NOT oRs.EOF Then
		Do Until oRs.EOF
			If Request.Form(oRs("AccountID") & "_Activate") = "Yes" Then
				dbcon.execute("UPDATE members SET Activated = 1 WHERE AccountID = " & oRs("AccountID") & "")
				Call AdminLog("Activate Accounts", "Activated Account " & oRs("AccountID"))
			Else If Request.Form(oRs("AccountID") & "_Deny") = "Yes" Then
				


	Set Mailer = Server.CreateObject("CDO.Message")
	Set MailerCon = Server.CreateObject ("CDO.Configuration")
	MailerCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "relay-hosting.secureserver.net"
	MailerCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")  = 25 
	MailerCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
	MailerCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 

	' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
	'MailerCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
	'MailerCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") ="[email protected]"
	'MailerCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="[PasswordDeleted"

	MailerCon.Fields.Update 
	Set Mailer.Configuration = MailerCon

Mailer.From = "[email protected]"
Mailer.To = sEmail
	Mailer.Subject = "MPlayer " & GLOBAL_GAME_NAME & " League - Account Deleted"

				Mailer.TextBody = Mailer.TextBody & "----------------------------------------------------" & vbNewLine
				Mailer.TextBody = Mailer.TextBody & "*        Automated @ The MPlayer League Network          *" & vbNewLine
				Mailer.TextBody = Mailer.TextBody & "----------------------------------------------------" & vbNewLine & vbNewLine
				Mailer.TextBody = Mailer.TextBody & sUsername & "," & vbNewLine & vbNewLine
				Mailer.TextBody = Mailer.TextBody & "Your account on the MPlayer" & GLOBAL_GAME_NAME & " League has been deleted by " & Session(CURRENT_ABBR & "_Username") & "." & vbNewLine & vbNewLine
				Mailer.TextBody = Mailer.TextBody & "As a result of the denial, the account has been deleted from our databases, feel free to signup again but this time activate your account." & vbNewLine & vbNewLine
				Mailer.TextBody = Mailer.TextBody & "Regards," & vbNewLine
				Mailer.TextBody = Mailer.TextBody & "MPlayer League."
	Mailer.Send 
Set Mailer = Nothing
	Set MailerCon = Nothing
End If
%>
Thank You in advance.
 
Old January 3rd, 2010, 06:44 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Looks like the code posted above has not matching if - else statements:

check the code below:
Code:
<!-- #Include File='../includes/inc_includes.asp' -->
<!-- #Include File='includes/level3.asp'-->

<%
 Set dbcon=DBConnect(DB_MAIN)
 rSQL = "SELECT AccountID, Username, Email FROM Members WHERE Activated = FALSE ORDER BY AccountID ASC"
 Set oRs=DBRecordSet(dbcon, rSQL)
  If NOT oRs.EOF Then
   Do Until oRs.EOF
    If Request.Form(oRs("AccountID") & "_Activate") = "Yes" Then
     dbcon.execute("UPDATE members SET Activated = 1 WHERE AccountID = " & oRs("AccountID") & "")
     Call AdminLog("Activate Accounts", "Activated Account " & oRs("AccountID"))
    ElseIf Request.Form(oRs("AccountID") & "_Deny") = "Yes" Then
     Set Mailer = Server.CreateObject("CDO.Message")
     Set MailerCon = Server.CreateObject ("CDO.Configuration")
     MailerCon.Fields("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = "relay-hosting.secureserver.net"
     MailerCon.Fields("http://schemas.microsoft.com/cdo/con...smtpserverport")  = 25 
     MailerCon.Fields("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 2 
     MailerCon.Fields("http://schemas.microsoft.com/cdo/con...nectiontimeout") = 60 
     ' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
     'MailerCon.Fields("http://schemas.microsoft.com/cdo/con...tpauthenticate") = 1 'basic (clear-text) authentication
     'MailerCon.Fields("http://schemas.microsoft.com/cdo/con...n/sendusername") ="[email protected]"
     'MailerCon.Fields("http://schemas.microsoft.com/cdo/con...n/sendpassword") ="[PasswordDeleted"
     MailerCon.Fields.Update 
     Set Mailer.Configuration = MailerCon
     Mailer.From = "[email protected]"
     Mailer.To = sEmail
     Mailer.Subject = "MPlayer " & GLOBAL_GAME_NAME & " League - Account Deleted"
     Mailer.TextBody = Mailer.TextBody & "----------------------------------------------------" & vbNewLine
     Mailer.TextBody = Mailer.TextBody & "*        Automated @ The MPlayer League Network          *" & vbNewLine
     Mailer.TextBody = Mailer.TextBody & "----------------------------------------------------" & vbNewLine & vbNewLine
     Mailer.TextBody = Mailer.TextBody & sUsername & "," & vbNewLine & vbNewLine
     Mailer.TextBody = Mailer.TextBody & "Your account on the MPlayer" & GLOBAL_GAME_NAME & " League has been deleted by " & Session(CURRENT_ABBR & "_Username") & "." & vbNewLine & vbNewLine
     Mailer.TextBody = Mailer.TextBody & "As a result of the denial, the account has been deleted from our databases, feel free to signup again but this time activate your account." & vbNewLine & vbNewLine
     Mailer.TextBody = Mailer.TextBody & "Regards," & vbNewLine
     Mailer.TextBody = Mailer.TextBody & "MPlayer League."
     Mailer.Send 
     Set Mailer = Nothing
     Set MailerCon = Nothing
    End If
    oRs.moveNext
   loop 
  End if  
%>
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.
The Following User Says Thank You to om_prakash For This Useful Post:
par0ar (January 3rd, 2010)
 
Old January 3rd, 2010, 10:22 PM
Registered User
 
Join Date: Jan 2010
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks for the help.

Its working now





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Expected end of statement crabjoe Classic ASP Basics 3 December 4th, 2007 12:52 AM
Expected end islandtiu BOOK: Beginning ASP 3.0 5 January 17th, 2006 10:19 AM
expected end of statement Adam H-W Classic ASP Databases 3 January 4th, 2005 05:37 AM
(0x800A03F6) Expected 'End' walrus Classic ASP Databases 5 April 15th, 2004 04:10 AM
expected end of statement....help.... chaoz83 Classic ASP Databases 3 September 23rd, 2003 01:19 PM





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