Solved

Why is this giving me an error of end of stmt expected

Posted on 2009-05-15
3
307 Views
Last Modified: 2013-12-26
Dim Fullname.Text as string() = cstr(Request.Form("Fullname"))  
    ~~~~~~~~                                                    
C:\inetpub\wwwbonney\index_files\feedbackconfirm.aspx(15) : error BC30205: End of statement expected.

Dim Fullname.Text as string() = cstr(Request.Form("Fullname"))  
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ Page Language="vb" aspcompat=true debug=true Explicit="True" %>
<%@ Import Namespace="ADODB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Web.Mail" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Reflection" %>
<%@ Import Namespace="DimpleSoftwares.ASPNET.Components" %>
<script language="vb" runat="server">
 
 
Dim Fullname.Text as string() = cstr(Request.Form("Fullname"))  
Dim Address.Text as string() =  cstr(Request.Form("Address")) 
Dim City.Text as string() = cstr(Request.Form("City")) 
Dim States.Text as string() = cstr(Request.Form("States")) 
Dim Country.Text as string() = cstr(Request.Form("Country")) 
Dim Postcode.Text as string() = cstr(Request.Form("Postcode")) 
Dim Phone.Text as string() = cstr(Request.Form("Phone")) 
Dim selection2.Text as string()  
Dim selection3.Text as string()  
Dim selection4 as string()
Dim selection5 as string() 
 
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
	      	 
			 
		   
		   If ValidEmail then
		     selection2.Text = "Email has been successfully sent!"
                     selection3.Text = "And your details sent to bonneyplace@acslink.net.au"
                     
		     SendMail()
		     
		   else
		    selection2.Text = "Feedback is alsmost complete!"
                    selection3.Text = "However your email is invalid!"
                    selection4.Text = "Please click the back button and correct this before resubmitting."
                    selection5.Text = "  " 
		   end if		
 
    End Sub
	
        Private Function ValidEmail() As Boolean
 
 
		Dim e   =  new EmailAddressValidator()
		
 
			e.DnsServer = "58.108.193.62"
			e.SmtpFromEmail = "coach@halinasplace.com.au"
			e.SmtpFromDomain = "mail.halinasplace.com.au"
			e.UseMXCach = true						
				
			if e.Validate(cstr(Request.Form("Email")))			
			Return True
			end if			
 
 
	End Function
	
	Private Sub SendMail()
	dim Mail	
	Mail = Server.CreateObject("CDO.Message")
		dim objMessage,objConfig,Flds,MyBody
 		objMessage = Server.CreateObject("cdo.message")
        objConfig = Server.CreateObject("cdo.configuration")
' Setting the SMTP Server
        Flds = objConfig.Fields
        Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.halinasplace.com.au"
        Flds.update
 
        objMessage.Configuration = objConfig
        objMessage.To = "bonneyplace@acslink.net.au"
        objMessage.From = cstr(Request.Form("Email"))
        objMessage.Subject = "From Bonney Place Website"
        MyBody = "Name :" & cstr(Request.Form("Fullname")) &  vbCrLf 
		MyBody = MyBody &  vbCrLf & vbCrLf 
        MyBody = MyBody &  "Phone:" & cstr(Request.Form("Phone")) 
		MyBody = MyBody &  vbCrLf & vbCrLf 
        MyBody = MyBody & "Address:" & cstr(Request.Form("Address")) & "," & cstr(Request.Form("city")) & "," & cstr(Request.Form("States")) & "," & cstr(Request.Form("Country")) & " " & cstr(Request.Form("Postcode")) 
        MyBody = MyBody &  vbCrLf & vbCrLf 
		MyBody = MyBody &  "E-mail:" & cstr(Request.Form("Email")) 
		MyBody = MyBody &  vbCrLf & vbCrLf 
		
		objMessage.TextBody = MyBody    
        objMessage.fields.update
        objMessage.Send
        objMessage = nothing
        objConfig = nothing	
			       	
			       
    End Sub
	
 
</script>

Open in new window

0
Comment
Question by:halinab
3 Comments
 
LVL 12

Expert Comment

by:Krys_K
ID: 24403544
Hi
if you comment out that line do you get teh same error message on the next line Dim Address.Text as string() =  cstr(Request.Form("Address"))
Just a thought, if you do then it suggest that it doesn't like the way you are DIMing the statement or something???
Regards
Krystian

0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 24403652
Should it not be:
Dim Fullname As string = CStr(Request.Form("Fullname"))
0
 

Author Closing Comment

by:halinab
ID: 31582154
yes perfect - worked fine
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Paint/Redraw window while dragging 16 83
VB6 - Convert HH:MM into Decimal 8 63
vb6 - Transfer from MSHFlexgrid1 to xls issue 8 56
VB6 ListBox Question 4 50
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question