[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[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!

7.4

INSERT to MySQL DB using ASP

Asked by Aus2Srq in MySQL Server, Programming for ASP.NET, Active Server Pages (ASP)

Tags: mysql, insert, asp

I'm a PHP/mySQL guy but now I need to know how to connect to mySQL db using ASP and validate as some fields are required. The syntax is VERY different and after banging my head looking online for a bit of help, could the EE Gods plese help me.

Here is my form on an html page (not sure if it needs to be asp):
<form name="mailinglist" method="post" action="dbconn.asp">
<label for="fname">First Name:*</xxx>
<input type="text" id="fname" name="fname" maxlength="30" class="txtbox" /><br />
<label for="lname">Last Name:*</xx>
<input type="text" id="lname" name="lname" maxlength="30" class="txtbox" /><br />
<label for="add1">Address 1</label>
<input type="text" id="add1" name="add1" maxlength="80" class="txtbox" /><br />
<label for="add2">Address 2</xx>
<input type="text" id="add2" name="add2" maxlength="80" class="txtbox" /><br />
<label for="city">City:</label>
<input type="text" id="city" name="city" maxlength="30" class="txtbox" /><br />
<label for="state">State:</label>
<input type="text" id="state" name="state" maxlength="30" class="txtbox" /><br />
<label for="zip">Zip:*</label>
<input type="text" id="zip" name="zip" maxlength="5" class="txtbox" /><br />
<label for="add2">Email:*</label>
<input type="text" id="email" name="email" maxlength="80" class="txtbox" /><br />
<label for="phone">Telephone:</x>
<input type="text" id="phone" name="phone" maxlength="14" class="txtbox" /><br /><br />
<input type="image" name="submit" src="images/joinlist_submit.gif" class="img" />
<img class="img" src="images/joinlist_clear.gif" onClick="javascript:document.mailinglist.reset();return false">
</form>

on the dbconn.asp page i have:
<%
Dim sConnection, objConn , strSQL
Dim x_fname, x_lname, x_add1, x_add2, x_city, x_state, x_zip, x_email, x_phone
x_name = Request.Form("fname")
x_lname = Request.Form("lname")
x_add1 = Request.Form("add1")
x_add2 = Request.Form("add2")
x_city = Request.Form("city")
x_state = Request.Form("state")
x_zip = Request.Form("zip")
x_email = Request.Form("email")
x_phone = Request.Form("phone")


sConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=xx.com; DATABASE=xx; UID=x;PASSWORD=xxxxx; OPTION=3"
Set objConn = Server.CreateObject("ADODB.Connection")

objConn.Open(sConnection)

strSQL = "INSERT INTO mailinglist (fname, lname, add1, add2, city, state, zip, email, phone) VALUES (???)"

objConn.Close
Set objConn = Nothing
%>

I need form validation to return an error message if fname, lname, zip and email are not filled, otherwise INSERT INTO mailinglist, redirect to Thankyou.html and have a nice day!

(Points set to 500 for urgency)

Thank you!
~Aus2Srq
[+][-]02/15/07 11:55 PM, ID: 18546768Accepted Solution

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

Zones: MySQL Server, Programming for ASP.NET, Active Server Pages (ASP)
Tags: mysql, insert, asp
Sign Up Now!
Solution Provided By: amit_g
Participating Experts: 4
Solution Grade: A
 
[+][-]02/16/07 12:53 AM, ID: 18546926Expert Comment

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.

 
[+][-]02/16/07 04:01 AM, ID: 18547616Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

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

 
[+][-]02/16/07 04:03 AM, ID: 18547625Expert Comment

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.

 
[+][-]02/16/07 04:11 AM, ID: 18547669Author Comment

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.

 
[+][-]02/16/07 04:13 AM, ID: 18547681Expert Comment

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.

 
[+][-]02/16/07 04:18 AM, ID: 18547715Expert Comment

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.

 
[+][-]02/16/07 04:45 AM, ID: 18547851Author Comment

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.

 
[+][-]02/16/07 05:09 AM, ID: 18547990Expert Comment

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.

 
[+][-]02/16/07 05:11 AM, ID: 18548001Expert Comment

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.

 
[+][-]02/16/07 05:54 AM, ID: 18548281Author Comment

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.

 
[+][-]02/16/07 06:19 AM, ID: 18548484Author Comment

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.

 
[+][-]02/16/07 10:09 AM, ID: 18550485Expert Comment

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.

 
[+][-]02/16/07 10:28 AM, ID: 18550657Expert Comment

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...
20091111-EE-VQP-89