...

View Full Version : VBScript compilation (0x800A03F6)



Rade5
09-02-2004, 01:05 AM
Hi guys

I'm having problems with this error. 'Expected end - line 77'

pls help (below is my code)

Thkx

<%
Function ChkString(str)

str = replace(str, "<", "&lt;", 1, -1, 1)
str = replace(str, ">", "&gt;", 1, -1, 1)

ChkString = str
End Function

name = trim(ChkString(Request.form("name")))
email = trim(ChkString(Request.form("email")))
address = trim(ChkString(Request.form("address")))
City = trim(ChkString(Request.form("city")))
State = trim(ChkString(Request.form("state")))
Country = trim(ChkString(Request.form("country")))
Zipcode = trim(ChkString(Request.form("zip")))
Password = trim(ChkString(Request.form("password")))

ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("member.mdb")
set my_conn= Server.CreateObject("ADODB.Connection")


if rscheck.eof then
set rs = server.CreateObject("ADODB.RecordSet")
if been_here_before="No" then
end if

RScheck.close
set rs = server.CreateObject("adodb.recordset")
if been_here_before="No" then
sql ="select * from member"

RS.open Sql,my_conn,1,3
RS.AddNew
RS("Name")=name
RS("email")=email
RS("address")=address
RS("city")=city
RS("state")=state
RS("country")=country
RS("zipcode")=zipcode
RS("password")= password
RS("memberdate")= now()

RS.update
%>
<body bgcolor="#99CCFF">

<center><font face="Verdana" size="2">Your Account Has Been Processed!! <br>
Your User ID is : <%=email%> , and your password is : <%=password%>
</font>
<p><a href="login.asp"><font face="Verdana" size="2">Go to Login Page</font> </a>

</p></center>

<%
else
%>
<center><font face="Verdana" size="2">Your have signup already with this email<br>
Please signup with another your email address.
</font>
<p><a href="signup.asp"><font face="Verdana" size="2">Sign up Again! </font> </a></center>



<%


rs.close
my_conn.Close
set my_conn = nothing
set rs = nothing

end if%> --- line 77

Roelf
09-02-2004, 09:26 AM
<%
Function ChkString(str)

str = replace(str, "<", "&lt;", 1, -1, 1)
str = replace(str, ">", "&gt;", 1, -1, 1)

ChkString = str
End Function

name = trim(ChkString(Request.form("name")))
email = trim(ChkString(Request.form("email")))
address = trim(ChkString(Request.form("address")))
City = trim(ChkString(Request.form("city")))
State = trim(ChkString(Request.form("state")))
Country = trim(ChkString(Request.form("country")))
Zipcode = trim(ChkString(Request.form("zip")))
Password = trim(ChkString(Request.form("password")))

ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("member.mdb")
set my_conn= Server.CreateObject("ADODB.Connection")

if rscheck.eof then
set rs = server.CreateObject("ADODB.RecordSet")
if been_here_before="No" then
end if

RScheck.close
set rs = server.CreateObject("adodb.recordset")
if been_here_before="No" then
sql ="select * from member"

RS.open Sql,my_conn,1,3
RS.AddNew
RS("Name")=name
RS("email")=email
RS("address")=address
RS("city")=city
RS("state")=state
RS("country")=country
RS("zipcode")=zipcode
RS("password")= password
RS("memberdate")= now()

RS.update
%>
<body bgcolor="#99CCFF">

<center><font face="Verdana" size="2">Your Account Has Been Processed!! <br>
Your User ID is : <%=email%> , and your password is : <%=password%>
</font>
<p><a href="login.asp"><font face="Verdana" size="2">Go to Login Page</font> </a>

</p></center>

<%
else
%>
<center><font face="Verdana" size="2">Your have signup already with this email<br>
Please signup with another your email address.
</font>
<p><a href="signup.asp"><font face="Verdana" size="2">Sign up Again! </font> </a></center>



<%


rs.close
my_conn.Close
set my_conn = nothing
set rs = nothing

end if%> --- line 77
i colored the starting of If blocks red, and the ending blue, as you can see, you miss one end

Rade5
09-02-2004, 11:22 PM
I tried your suggestion, but I'm still getting the same error on the last line. I made a few changes to the code - not sure if that the problem. Pls see the code below

Thkx
---------------------------------------------------------------



<%
Function ChkString(str)

str = replace(str, "<", "&lt;", 1, -1, 1)
str = replace(str, ">", "&gt;", 1, -1, 1)

ChkString = str
End Function

Name = trim(ChkString(Request.form("name")))
Email = trim(ChkString(Request.form("email")))
Telephonenumber = trim(ChkString(Request.form("telephonenumber")))
Mobilenumber = trim(ChkString(Request.form("mobilenumber")))
Address = trim(ChkString(Request.form("address")))
City = trim(ChkString(Request.form("city")))
Country = trim(ChkString(Request.form("country")))
Code = trim(ChkString(Request.form("Code")))

ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("member.mdb")
set my_conn= Server.CreateObject("ADODB.Connection")


if rscheck.eof then
set rs = server.CreateObject("ADODB.RecordSet")
if been_here_before="No" then
end if

RScheck.close
set rs = server.CreateObject("adodb.recordset")
if been_here_before="No" then
sql ="select * from member"

RS.open Sql,my_conn,1,3
RS.AddNew
RS("Name")=name
RS("email")=email
RS("Telephonenumber")=telephonenumber
RS("Mobilenumber")=mobilenumber
RS("address")=address
RS("city")=city
RS("country")=country
RS("code")=code

RS.update
%>
<body bgcolor="#99CCFF">

<center><font face="Verdana" size="2">Your details have been stored!! <br>
</font></center>


<%
else
%>

<center><font face="Verdana" size="2">There's an account associated to this email address<br>
Please logon using correct details. Thank you.</font></center>



<%
rs.close
my_conn.Close
set my_conn = nothing
set rs = nothing

end if%>

miranda
09-03-2004, 04:02 AM
You still do not have the last end if in there. I am guessing that you are a beginner at programming. When I was in school one of the first things we were taught was INDENT YOUR CODE!!! then you would have seen what Roelf told you. Here it is with the last end if added



Function ChkString(str)
str = replace(str, "<", "&lt;", 1, -1, 1)
str = replace(str, ">", "&gt;", 1, -1, 1)
ChkString = str
End Function

name = trim(ChkString(Request.form("name")))
email = trim(ChkString(Request.form("email")))
address = trim(ChkString(Request.form("address")))
City = trim(ChkString(Request.form("city")))
State = trim(ChkString(Request.form("state")))
Country = trim(ChkString(Request.form("country")))
Zipcode = trim(ChkString(Request.form("zip")))
Password = trim(ChkString(Request.form("password")))

ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("member.mdb")
set my_conn= Server.CreateObject("ADODB.Connection")

if rscheck.eof then
set rs = server.CreateObject("ADODB.RecordSet")
if been_here_before="No" then
end if

RScheck.close
set rs = server.CreateObject("adodb.recordset")
if been_here_before="No" then
sql ="select * from member"

RS.open Sql,my_conn,1,3
RS.AddNew
RS("Name")=name
RS("email")=email
RS("address")=address
RS("city")=city
RS("state")=state
RS("country")=country
RS("zipcode")=zipcode
RS("password")= password
RS("memberdate")= now()
RS.update
%>
<body bgcolor="#99CCFF">

<center><font face="Verdana" size="2">Your Account Has Been Processed!! <br>
Your User ID is : <%=email%> , and your password is : <%=password%>
</font>
<p><a href="login.asp"><font face="Verdana" size="2">Go to Login Page</font> </a>

</p></center>

<%
else
%>
<center><font face="Verdana" size="2">Your have signup already with this email<br>
Please signup with another your email address.
</font>
<p><a href="signup.asp"><font face="Verdana" size="2">Sign up Again! </font> </a></center>

<%
rs.close
my_conn.Close
set my_conn = nothing
set rs = nothing

end if
end if ' missing end if has been added
%>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum