Advertisement

05.09.2008 at 03:04AM PDT, ID: 23388804
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Validate information entered in fields on a database asp form ?

Asked by PhilAllenpja in Active Server Pages (ASP)

Tags: , ,

I have managed to put together my first form that opens a database and then inputs the data into the form and also send a email out to the person that entered and a copy to a collegue.

As this is the first time i have done this i am now trying to tidy it up a little! I need to ensure that all fiels are validated and that one of the main fields (entitled description) is restricted to 70 Words only ! Also as there are many spam scams going on at present i am looking to find a solutions to ensure the database is not spammed !

Here is my asp code for sending the email and database input, is this where the validation can be added and who can i inform the user that they have not entered information ?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
<%
'Dimension variables
Dim adoCon          'Holds the Database Connection Object
Dim rsAddCatentry   'Holds the recordset for the new record to be added
Dim strSQL          'Holds the SQL query to query the database
 
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
 
 'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & "D:\customer\eurobusxpo\database\cat_entry_info.mdb"
 
 'Create an ADO recordset object
Set rsAddcatalogueentry = Server.CreateObject("ADODB.Recordset") 
 
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblcatalogueentry.Contact_name, tblcatalogueentry.Stand_number, tblcatalogueentry.Contact_email, tblcatalogueentry.ad_1, tblcatalogueentry.ad_2, tblcatalogueentry.ad_3, tblcatalogueentry.ad_4, tblcatalogueentry.ad_5, tblcatalogueentry.Postcode, tblcatalogueentry.Company_name, tblcatalogueentry.Tel, tblcatalogueentry.Fax, tblcatalogueentry.Website, tblcatalogueentry.CPT_Member, tblcatalogueentry.Company_description, tblcatalogueentry.Product_type  FROM tblcatalogueentry;"
 
'Set the cursor type we are using so we can navigate through the recordset
rsAddcatalogueentry.CursorType = 2
 
'Set the lock type so that the record is locked by ADO when it is updated
rsAddcatalogueentry.LockType = 3
 
'Open the recordset with the SQL query 
rsAddcatalogueentry.Open strSQL, adoCon
 
'Tell the recordset we are adding a new record to it
rsAddcatalogueentry.AddNew
 
'Add a new record to the recordset
rsAddcatalogueentry.Fields("Contact_name") = Request.Form("name")
rsAddcatalogueentry.Fields("Stand_number") = Request.Form("stand_no")
rsAddcatalogueentry.Fields("Contact_email") = Request.Form("email")
rsAddcatalogueentry.Fields("Company_name") = Request.Form("cname")
rsAddcatalogueentry.Fields("Ad_1") = Request.Form("Address_1")
rsAddcatalogueentry.Fields("Ad_2") = Request.Form("Address_2")
rsAddcatalogueentry.Fields("Ad_3") = Request.Form("Address_3")
rsAddcatalogueentry.Fields("Ad_4") = Request.Form("Address_4")
rsAddcatalogueentry.Fields("Ad_5") = Request.Form("Address_5")
rsAddcatalogueentry.Fields("Postcode") = Request.Form("P_code")
rsAddcatalogueentry.Fields("Tel") = Request.Form("tel_no")
rsAddcatalogueentry.Fields("Fax") = Request.Form("fax_no")
rsAddcatalogueentry.Fields("Website") = Request.Form("webs")
rsAddcatalogueentry.Fields("CPT_member") = Request.Form("cpt")
rsAddcatalogueentry.Fields("Company_description") = Request.Form("comp_des")
rsAddcatalogueentry.Fields("Product_type") = Request.Form("Prod_list")
 
 
'Write the updated recordset to the database
rsAddcatalogueentry.Update
 
'Reset server objects
rsAddcatalogueentry.Close
Set rsAddcatalogueentry = Nothing
Set adoCon = Nothing
 
Dim objEmail 'stores mailer control instance 
Set objEmail = Server.CreateObject("Dundas.Mailer")
 
'Mailer object
objEmail.TOs.Add(Request.Form("email"))
objEmail.BCCs.Add("helen.conway@expom.co.uk")
objEmail.FromAddress = "Eurobus Expo 2008 Website (Do Not Reply)<info@eurobusxpo.com>"
objEmail.Subject = "Eurobus Catalogue Entry Form :"
 
 
' use either of these two servers
objEmail.SMTPRelayServers.Add "smtp.altohiway.com"
objEmail.SMTPRelayServers.Add "smtp.mailcontroller.altohiway.com"
 
'Declare a new variable
Dim HTMLBody
 
HTMLBody = "The following is feedback from my web site." & vbcrlf & vbcrlf
HTMLBody = HTMLBody & "First Name: " & request.form("name") & vbCrLf
 
objEmail.HTMLBody = "Thank you for submitting your Free Catalogue Entry for Euro Bus Expo 2008. Your Details Entered are as follows: " & "<br>"_
	& "Contact Name: " & Request.Form("name")  & "<br>"_
	& "Stand Number: " & Request.Form("Stand_no") & "<br>"_
	& "Email Address: " & Request.Form("email") & "<br>"_
	& "Company Name: " & Request.Form("Cname") & "<br>" _
	& "Address 1: " & Request.Form("Address_1") & "<br>" _
	& "Address 2: " & Request.Form("Address_2") & "<br>" _
	& "Address 3: " & Request.Form("Address_3") & "<br>" _
	& "Address 4: " & Request.Form("Address_4") & "<br>" _
	& "Address 5: " & Request.Form("Address_5") & "<br>" _
	& "Postcode: " & Request.Form("P_code") & "<br>" _
	& "Telephone Number: " & Request.Form("tel_no") & "<br>" _
	& "Website: " & Request.Form("webs") & "<br>" _
	& "CPT Member: " & Request.Form("cpt") & "<br>" _
	& "Company Description: " & Request.Form("comp_des") & "<br>" _
	& "Product Description: " & Request.Form("Prod_list") & "<br>" _
	& "Completed"
 
objEmail.SendMail
 
'Redirect to the guestbook.asp page
Response.Redirect "exhibitors_cat_entry_complete.asp"
%>
 
Loading Advertisement...
 
[+][-]05.09.2008 at 06:06AM PDT, ID: 21532347

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 06:27AM PDT, ID: 21532504

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 07:36AM PDT, ID: 21533236

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 07:38AM PDT, ID: 21533269

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 07:40AM PDT, ID: 21533282

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 08:00AM PDT, ID: 21533523

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 08:02AM PDT, ID: 21533543

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 08:11AM PDT, ID: 21533645

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 09:49AM PDT, ID: 21534622

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 12:54AM PDT, ID: 21545203

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 12:55AM PDT, ID: 21545207

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 02:57AM PDT, ID: 21545594

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 03:00AM PDT, ID: 21545601

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 05:31AM PDT, ID: 21546256

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 06:01AM PDT, ID: 21546514

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 06:20AM PDT, ID: 21546702

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 06:30AM PDT, ID: 21546778

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 06:34AM PDT, ID: 21546812

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 06:41AM PDT, ID: 21546879

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 06:49AM PDT, ID: 21546937

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 07:06AM PDT, ID: 21547064

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 07:18AM PDT, ID: 21547191

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Sign Up Now!
Solution Provided By: samic400
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.12.2008 at 07:28AM PDT, ID: 21547279

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 07:36AM PDT, ID: 21547340

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 07:51AM PDT, ID: 21547474

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 07:58AM PDT, ID: 21547524

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 - Hierarchy / EE_QW_2_20070628