Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    INSERT INTO error

    hi, i need to develop a sign up page and have limited knowledge about asp. i keep receiving this error when i tried to enter value into the text field.

    Microsoft JET Database Engine error '80040e14'

    Syntax error in INSERT INTO statement.

    /guest_test/signup.asp, line 304


    can someone please tell me why this is happens

    Code:
    <!-- #include file = "connection.asp" -->
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
    
    transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sign Up</title>
    </head>
    
    <body>
    
    <h1> Sign Up</h1>
    <br/>
    <form name="signup" method="post" action="">
    	<p>Full Name : <input type="text" name="fname" size="30" maxlength="40" /></p>	
    	<p>Username : <input type="text" name="uname" size="30" maxlength="40" /></p>
    	<p>Password : <input type="password" name="pswrd" size="30" maxlength="40" /></p>
    	<p>Email : <input type="text" name="email" size="30" maxlength="40" /></p>	
    	<p> Gender : 
    	<select name="gender">
    		<option value=""></option>
    		<option value="Male">Male</option>
    		<option value="Female">Female</option>
    	</select>
    	</p>	
    	<p> Address Line 1 : <input type="text" name="add1" size="40" maxlength="50" /></p>	
    	<p> Address Line 2 : <input type="text" name="add2" size="40" maxlength="50" /></p>
    	<p> City : <input type="text" name="city" size="20" maxlength="30" /></p>	
    	<p> Zip : <input type="text" name="zip" size="20" maxlength="30" /></p>	
    	<p>Country :
    	<select name="country">
          		<option value="" selected></option>
    		<option value="Afg">Afghanistan</option>
    		<option value="Alb">Albania</option>
    		<option value="Alg">Algeria</option>
    		<option value="AmSa">American Samoa</option>
    		<option value="Ando">Andorra</option>
    		<option value="Ango">Angola</option>
    		<option value="Agla">Anguilla</option>
    		<option value="AntBar">Antigua and Barbuda</option>
    		<option value="Agnt">Argentina</option>
    		<option value="Armn">Armenia</option>
    		<option value="Arb">Aruba</option>
    		<option value="Aust">Australia</option>
    		<option value="Astr">Austria</option>
    		<option value="Azbj">Azerbaijan</option>
    		<option value="Bhms">Bahamas</option>
    		<option value="Bhrn">Bahrain</option>
    		<option value="Bgld">Bangladesh</option>
    		<option value="Brbd">Barbados</option>
    		<option value="Blrs">Belarus</option>
    		<option value="Blgm">Belgium</option>
    		<option value="Blze">Belize</option>
    		<option value="Bnn">Benin</option>
    		<option value="Brmd">Bermuda</option>
    		<option value="Bhtn">Bhutan</option>
    		<option value="Blva">Bolivia</option>
    		<option value="Bnre">Bonaire</option>
    		<option value="BHrv">Bosnia and Herzegovina</option>
    		<option value="Bstw">Botswana</option>
    		<option value="Brzl">Brazil</option>
    		<option value="Biot">British Indian Ocean Ter</option>
    		<option value="Brni">Brunei</option>
    		<option value="Blga">Bulgaria</option>
    		<option value="BkFs">Burkina Faso</option>
    		<option value="Brdi">Burundi</option>
    		<option value="Cmbd">Cambodia</option>
    		<option value="Cmro">Cameroon</option>
    		<option value="Cnd">Canada</option>
    		<option value="CnIs">Canary Islands</option>
    		<option value="CpVe">Cape Verde</option>
    		<option value="CyIs">Cayman Islands</option>
    		<option value="CnAR">Central African Republic</option>
    		<option value="Chd">Chad</option>
    		<option value="ChnIs">Channel Islands</option>
    		<option value="Chle">Chile</option>
    		<option value="Chn">China</option>
    		<option value="CrstIs">Christmas Island</option>
    		<option value="CoIs">Cocos Island</option>
    		<option value="Clmb">Colombia</option>
    		<option value="Cmrs">Comoros</option>
    		<option value="Cng">Congo</option>
    		<option value="CokIs">Cook Islands</option>
    		<option value="Cost">Costa Rica</option>
    		<option value="Cote">Cote D'Ivoire</option>
    		<option value="Crta">Croatia</option>
    		<option value="Cuba">Cuba</option>
    		<option value="Curc">Curacao</option>
    		<option value="Cypr">Cyprus</option>
    		<option value="Czch">Czech Republic</option>
    		<option value="Dnmk">Denmark</option>
    		<option value="Djbti">Djibouti</option>
    		<option value="Dmnc">Dominica</option>
    		<option value="DmncR">Dominican Republic</option>
    		<option value="EasT">East Timor</option>
    		<option value="Ecud">Ecuador</option>
    		<option value="Egpt">Egypt</option>
    		<option value="ESal">El Salvador</option>
    		<option value="EqGu">Equatorial Guinea</option>
    		<option value="Ertr">Eritrea</option>
    		<option value="Estn">Estonia</option>
    		<option value="Ethp">Ethiopia</option>
    		<option value="FlIs">Falkland Islands</option>
    		<option value="FrIs">Faroe Islands</option>
    		<option value="Fiji">Fiji</option>
    		<option value="Fld">Finland</option>
    		<option value="Frnc">France</option>
    		<option value="FrnG">French Guiana</option>
    		<option value="FrnP">French Polynesia</option>
    		<option value="FrnST">French Southern Ter</option>
    		<option value="Gabon">Gabon</option>
    		<option value="Gmbi">Gambia</option>
    		<option value="Grgi">Georgia</option>
    		<option value="Grmy">Germany</option>
    		<option value="Ghna">Ghana</option>
    		<option value="Gblt">Gibraltar</option>
    		<option value="GrBt">Great Britain</option>
    		<option value="Grce">Greece</option>
    		<option value="Grld">Greenland</option>
    		<option value="Grnd">Grenada</option>
    		<option value="Gdlp">Guadeloupe</option>
    		<option value="Guam">Guam</option>
    		<option value="Gtml">Guatemala</option>
    		<option value="Gina">Guinea</option>
    		<option value="Guyn">Guyana</option>
    		<option value="Hiti">Haiti</option>
    		<option value="Hwi">Hawaii</option>
    		<option value="Hdrs">Honduras</option>
    		<option value="HK">Hong Kong</option>
    		<option value="Hngy">Hungary</option>
    		<option value="IL">Iceland</option>
    		<option value="Ind">India</option>
    		<option value="Inds">Indonesia</option>
    		<option value="Irn">Iran</option>
    		<option value="Irq">Iraq</option>
    		<option value="Irld">Ireland</option>
    		<option value="IslM">Isle of Man</option>
    		<option value="Isrl">Israel</option>
    		<option value="Ity">Italy</option>
    		<option value="Jmc">Jamaica</option>
    		<option value="Jpn">Japan</option>
    		<option value="Jrdn">Jordan</option>
    		<option value="Kzktn">Kazakhstan</option>
    		<option value="Kny">Kenya</option>
    		<option value="Krbt">Kiribati</option>
    		<option value="KorN">Korea North</option>
    		<option value="KorS">Korea South</option>
    		<option value="Kwt">Kuwait</option>
    		<option value="Kgzsn">Kyrgyzstan</option>
    		<option value="Laos">Laos</option>
    		<option value="Ltva">Latvia</option>
    		<option value="Lebn">Lebanon</option>
    		<option value="Lsth">Lesotho</option>
    		<option value="Lbra">Liberia</option>
    		<option value="Lby">Libya</option>
    		<option value="Ltsn">Liechtenstein</option>
    		<option value="Ltna">Lithuania</option>
    		<option value="Lux">Luxembourg</option>
    		<option value="Mcu">Macau</option>
    		<option value="Mcdn">Macedonia</option>
    		<option value="Mdgs">Madagascar</option>
    		<option value="Msia">Malaysia</option>
    		<option value="Mlwi">Malawi</option>
    		<option value="Mldv">Maldives</option>
    		<option value="Mali">Mali</option>
    		<option value="Mlt">Malta</option>
    		<option value="MarIs">Marshall Islands</option>
    		<option value="Martq">Martinique</option>
    		<option value="Mrtn">Mauritania</option>
    		<option value="Mrts">Mauritius</option>
    		<option value="Myte">Mayotte</option>
    		<option value="Mxc">Mexico</option>
    		<option value="MidIs">Midway Islands</option>
    		<option value="Mldv">Moldova</option>
    		<option value="Mnc">Monaco</option>
    		<option value="Mgla">Mongolia</option>
    		<option value="Mtsr">Montserrat</option>
    		<option value="Mrcc">Morocco</option>
    		<option value="Mzmb">Mozambique</option>
    		<option value="Mynm">Myanmar</option>
    		<option value="Nmba">Nambia</option>
    		<option value="Naru">Nauru</option>
    		<option value="Npl">Nepal</option>
    		<option value="NthAt">Netherland Antilles</option>
    		<option value="Ntlds">Netherlands (Holland, Europe)</option>
    		<option value="Nvs">Nevis</option>
    		<option value="NCale">New Caledonia</option>
    		<option value="NZea">New Zealand</option>
    		<option value="Nicg">Nicaragua</option>
    		<option value="Ngr">Niger</option>
    		<option value="Ngra">Nigeria</option>
    		<option value="Niue">Niue</option>
    		<option value="NorfIs">Norfolk Island</option>
    		<option value="Nrwy">Norway</option>
    		<option value="Oman">Oman</option>
    		<option value="Pkst">Pakistan</option>
    		<option value="PlIs">Palau Island</option>
    		<option value="Plst">Palestine</option>
    		<option value="Pnm">Panama</option>
    		<option value="PaNG">Papua New Guinea</option>
    		<option value="PaRG">Paraguay</option>
    		<option value="Peru">Peru</option>
    		<option value="Phlp">Philippines</option>
    		<option value="PtIs">Pitcairn Island</option>
    		<option value="Plnd">Poland</option>
    		<option value="Prgl">Portugal</option>
    		<option value="PtRc">Puerto Rico</option>
    		<option value="Qtr">Qatar</option>
    		<option value="ReMt">Republic of Montenegro</option>
    		<option value="ReSb">Republic of Serbia</option>
    		<option value="Rein">Reunion</option>
    		<option value="Rmn">Romania</option>
    		<option value="Rsa">Russia</option>
    		<option value="Rwnd">Rwanda</option>
    		<option value="SBat">St Barthelemy</option>
    		<option value="SEus">St Eustatius</option>
    		<option value="SHel">St Helena</option>
    		<option value="StKN">St Kitts-Nevis</option>
    		<option value="StLu">St Lucia</option>
    		<option value="StMa">St Maarten</option>
    		<option value="StPM">St Pierre and Miquelon</option>
    		<option value="StVG">St Vincent and Grenadines</option>
    		<option value="Sipn">Saipan</option>
    		<option value="Smo">Samoa</option>
    		<option value="SmoA">Samoa American</option>
    		<option value="SMar">San Marino</option>
    		<option value="SaTP">Sao Tome and Principe</option>
    		<option value="SaAr">Saudi Arabia</option>
    		<option value="Sngl">Senegal</option>
    		<option value="Sycl">Seychelles</option>
    		<option value="SieL">Sierra Leone</option>
    		<option value="Sgpr">Singapore</option>
    		<option value="Slvk">Slovakia</option>
    		<option value="Slvn">Slovenia</option>
    		<option value="SolIs">Solomon Islands</option>
    		<option value="Smla">Somalia</option>
    		<option value="StAf">South Africa</option>
    		<option value="Spn">Spain</option>
    		<option value="SrLk">Sri Lanka</option>
    		<option value="Sdn">Sudan</option>
    		<option value="Srnm">Suriname</option>
    		<option value="Swzl">Swaziland</option>
    		<option value="Swdn">Sweden</option>
    		<option value="Swzl">Switzerland</option>
    		<option value="Syr">Syria</option>
    		<option value="Thti">Tahiti</option>
    		<option value="Twn">Taiwan</option>
    		<option value="Tjks">Tajikistan</option>
    		<option value="Tnza">Tanzania</option>
    		<option value="Thld">Thailand</option>
    		<option value="Togo">Togo</option>
    		<option value="Tklu">Tokelau</option>
    		<option value="Tnga">Tonga</option>
    		<option value="TriT">Trinidad and Tobago</option>
    		<option value="Tnsa">Tunisia</option>
    		<option value="Trky">Turkey</option>
    		<option value="Tkst">Turkmenistan</option>
    		<option value="TuC">Turks and Caicos Is</option>
    		<option value="Tuvl">Tuvalu</option>
    		<option value="Ugnd">Uganda</option>
    		<option value="Ukr">Ukraine</option>
    		<option value="UAE">United Arab Emirates</option>
    		<option value="UK">United Kingdom</option>
    		<option value="USA">United States of America</option>
    		<option value="Urgy">Uruguay</option>
    		<option value="Uzbt">Uzbekistan</option>
    		<option value="Vnt">Vanuatu</option>
    		<option value="VCS">Vatican City State</option>
    		<option value="Vnzl">Venezuela</option>
    		<option value="Vtnm">Vietnam</option>
    		<option value="ViIsB">Virgin Islands (Brit)</option>
    		<option value="ViIsU">Virgin Islands (USA)</option>
    		<option value="WkIs">Wake Island</option>
    		<option value="WlF">Wallis and Futana Is</option>
    		<option value="Ymn">Yemen</option>
    		<option value="Zire">Zaire</option>
    		<option value="Zmba">Zambia</option>
    		<option value="Zmbw">Zimbabwe</option>
    	</select>		
    	<p> Mobile Phone : <input type="text" name="phone" size="15" maxlength="20"/></p>
    	<p><input type="submit" name="submit" value="Sign Up" /></p>
    	<br/>
    </form>
    </body>
    </html>
    
    <%
    
    if request.form("submit")  = "Sign Up" then
    
    cfname = request.form("fname")
    cuname = request.form("uname")
    cpswrd = request.form("pswrd")
    cemail = request.form("email")
    cgender = request.form("gender")
    cadd1 = request.form("add1")
    cadd2 = request.form("add2")
    ccity = request.form("city")
    czip = request.form("zip")
    ccountry = request.form("country")
    cphone = request.form("phone")
    
    connection.Execute "Insert into Customer (Full_Name,Username,Password," &_
    "Email,Gender,Address_Line_1,Address_Line_2," &_
    "City,Zip,Country,Phone_Number)" &_
    " values ('" & cfname & "','" & cuname & "','" & cpswrd & "'," &_
    "'" & cemail & "','" & cgender & "','" & cadd1 & "'," &_
    "'" & cadd2 & "','" & ccity & "'," & czip & "," &_
    "'" & ccountry & "','" & cphone & "')"
    
    end if
    %>
    thank you.

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Do a response.write on your insert statement. This will generally point out what you are doing wrong. Since you are executing the statement directly just make this simple little change.

    If you aren't sure what it is that is wrong then show us what the response.write outputs


    Also you really neeed to sanitize your input. A simple apostrophe can be used to gain access to your database. For further clarification do a search on "SQL injection"

    Code:
    <%
    
    if request.form("submit")  = "Sign Up" then
    
    cfname = request.form("fname")
    cuname = request.form("uname")
    cpswrd = request.form("pswrd")
    cemail = request.form("email")
    cgender = request.form("gender")
    cadd1 = request.form("add1")
    cadd2 = request.form("add2")
    ccity = request.form("city")
    czip = request.form("zip")
    ccountry = request.form("country")
    cphone = request.form("phone")
    
    sSQL = "Insert into Customer (Full_Name,Username,Password," &_
    "Email,Gender,Address_Line_1,Address_Line_2," &_
    "City,Zip,Country,Phone_Number)" &_
    " values ('" & cfname & "','" & cuname & "','" & cpswrd & "'," &_
    "'" & cemail & "','" & cgender & "','" & cadd1 & "'," &_
    "'" & cadd2 & "','" & ccity & "'," & czip & "," &_
    "'" & ccountry & "','" & cphone & "')"
    
    Response.Write sSQL
    
    connection.Execute sSQL
    
    
    end if
    %>

  • #3
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    i made the changes and still get the errors..

    Insert into Customer (Full_Name,Username,Password,Email,Gender,Address_Line_1,Address_Line_2,City,Zip,Country,Phone_Numbe r) values ('asdasda','asdasd','asdad','123@yahoo.com','Male','asdadada','asdasdad','adsada',12344,'Bhms','0123 323233')

    Microsoft JET Database Engine error '80040e14'

    Syntax error in INSERT INTO statement.

    /guest_test/signup.asp, line 314

  • #4
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    double post.

  • #5
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    What is the data type of the zip in the database table? You are entering it as a numeric datatype. To find the datatype open the databse up in design view and look at the table structure what does it say next to the field name?

    also what are the field size limitations are any of the values larger than what you are trying to insert?
    Last edited by miranda; 12-14-2011 at 11:23 PM.

  • #6
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    I just noticed that you never open the connection object are you doing that somewhere else??

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,589
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    PASSWORD is a keyword in Access and JET OLEDB.

    So you need to put [...] around it when you don't want it used as a keyword. Probably a good idea to do that with USERNAME, as well.

    Code:
    sSQL = "Insert into Customer (Full_Name,[Username],[Password]," &_
                       "Email,Gender,Address_Line_1,Address_Line_2," &_
                       "City,Zip,Country,Phone_Number)" &_
    ...
    SQL Injection isn't a huge problem with the JET OLEDB driver, since it doesn't allow multiple queries. But it's still a good idea to "sanitize" all inputs that might have an apostrophe in them, at the very least.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #8
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Quote Originally Posted by Old Pedant View Post
    PASSWORD is a keyword in Access and JET OLEDB.
    SQL Injection isn't a huge problem with the JET OLEDB driver, since it doesn't allow multiple queries. But it's still a good idea to "sanitize" all inputs that might have an apostrophe in them, at the very least.
    Unless you want the Insert statement to throw an error everytime someone enters a name with an apostrophe in it.

  • #9
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    i set zip as number (integer). but i just change it to long integer.

    yes, i did create another file for the connection.

    i think it's working now, didn't have any error when i run it. but i'm not so sure about the SQL injection.

    Code:
    <!-- #include file = "connection.asp" -->
    
    <%
    
    function cleanInput(str)
    
    dim re
    set re = new RegExp
    re.Pattern = "[^-9a-zA-Z\\s]"
    re.Global = True
    cleanInput = re.Replace(str, "")
    set re = nothing
    
    end function
    
    %>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sign Up</title>
    </head>
    
    <body>
    
    <h1> Sign Up</h1>
    <br/>
    <form name="signup" method="post" action="">
    	<p>Full Name : <input type="text" name="fname" size="30" maxlength="40" /></p>	
    	<p>Username : <input type="text" name="uname" size="30" maxlength="40" /></p>
    	<p>Password : <input type="password" name="pswrd" size="30" maxlength="40" /></p>
    	<p>Email : <input type="text" name="email" size="30" maxlength="40" /></p>	
    	<p> Gender : 
    	<select name="gender">
    		<option value=""></option>
    		<option value="Male">Male</option>
    		<option value="Female">Female</option>
    	</select>
    	</p>	
    	<p> Address Line 1 : <input type="text" name="add1" size="40" maxlength="50" /></p>	
    	<p> Address Line 2 : <input type="text" name="add2" size="40" maxlength="50" /></p>
    	<p> City : <input type="text" name="city" size="20" maxlength="30" /></p>	
    	<p> Zip : <input type="text" name="zip" size="20" maxlength="30" /></p>	
    	<p>Country :
    	<select name="country">
          		<option value="" selected></option>
    		<option value="Afg">Afghanistan</option>
    		<option value="Alb">Albania</option>
    		<option value="Alg">Algeria</option>
    		<option value="AmSa">American Samoa</option>
    		<option value="Ando">Andorra</option>
    		<option value="Ango">Angola</option>
    		<option value="Agla">Anguilla</option>
    		<option value="AntBar">Antigua and Barbuda</option>
    		<option value="Agnt">Argentina</option>
    		<option value="Armn">Armenia</option>
    		<option value="Arb">Aruba</option>
    		<option value="Aust">Australia</option>
    		<option value="Astr">Austria</option>
    		<option value="Azbj">Azerbaijan</option>
    		<option value="Bhms">Bahamas</option>
    		<option value="Bhrn">Bahrain</option>
    		<option value="Bgld">Bangladesh</option>
    		<option value="Brbd">Barbados</option>
    		<option value="Blrs">Belarus</option>
    		<option value="Blgm">Belgium</option>
    		<option value="Blze">Belize</option>
    		<option value="Bnn">Benin</option>
    		<option value="Brmd">Bermuda</option>
    		<option value="Bhtn">Bhutan</option>
    		<option value="Blva">Bolivia</option>
    		<option value="Bnre">Bonaire</option>
    		<option value="BHrv">Bosnia and Herzegovina</option>
    		<option value="Bstw">Botswana</option>
    		<option value="Brzl">Brazil</option>
    		<option value="Biot">British Indian Ocean Ter</option>
    		<option value="Brni">Brunei</option>
    		<option value="Blga">Bulgaria</option>
    		<option value="BkFs">Burkina Faso</option>
    		<option value="Brdi">Burundi</option>
    		<option value="Cmbd">Cambodia</option>
    		<option value="Cmro">Cameroon</option>
    		<option value="Cnd">Canada</option>
    		<option value="CnIs">Canary Islands</option>
    		<option value="CpVe">Cape Verde</option>
    		<option value="CyIs">Cayman Islands</option>
    		<option value="CnAR">Central African Republic</option>
    		<option value="Chd">Chad</option>
    		<option value="ChnIs">Channel Islands</option>
    		<option value="Chle">Chile</option>
    		<option value="Chn">China</option>
    		<option value="CrstIs">Christmas Island</option>
    		<option value="CoIs">Cocos Island</option>
    		<option value="Clmb">Colombia</option>
    		<option value="Cmrs">Comoros</option>
    		<option value="Cng">Congo</option>
    		<option value="CokIs">Cook Islands</option>
    		<option value="Cost">Costa Rica</option>
    		<option value="Cote">Cote D'Ivoire</option>
    		<option value="Crta">Croatia</option>
    		<option value="Cuba">Cuba</option>
    		<option value="Curc">Curacao</option>
    		<option value="Cypr">Cyprus</option>
    		<option value="Czch">Czech Republic</option>
    		<option value="Dnmk">Denmark</option>
    		<option value="Djbti">Djibouti</option>
    		<option value="Dmnc">Dominica</option>
    		<option value="DmncR">Dominican Republic</option>
    		<option value="EasT">East Timor</option>
    		<option value="Ecud">Ecuador</option>
    		<option value="Egpt">Egypt</option>
    		<option value="ESal">El Salvador</option>
    		<option value="EqGu">Equatorial Guinea</option>
    		<option value="Ertr">Eritrea</option>
    		<option value="Estn">Estonia</option>
    		<option value="Ethp">Ethiopia</option>
    		<option value="FlIs">Falkland Islands</option>
    		<option value="FrIs">Faroe Islands</option>
    		<option value="Fiji">Fiji</option>
    		<option value="Fld">Finland</option>
    		<option value="Frnc">France</option>
    		<option value="FrnG">French Guiana</option>
    		<option value="FrnP">French Polynesia</option>
    		<option value="FrnST">French Southern Ter</option>
    		<option value="Gabon">Gabon</option>
    		<option value="Gmbi">Gambia</option>
    		<option value="Grgi">Georgia</option>
    		<option value="Grmy">Germany</option>
    		<option value="Ghna">Ghana</option>
    		<option value="Gblt">Gibraltar</option>
    		<option value="GrBt">Great Britain</option>
    		<option value="Grce">Greece</option>
    		<option value="Grld">Greenland</option>
    		<option value="Grnd">Grenada</option>
    		<option value="Gdlp">Guadeloupe</option>
    		<option value="Guam">Guam</option>
    		<option value="Gtml">Guatemala</option>
    		<option value="Gina">Guinea</option>
    		<option value="Guyn">Guyana</option>
    		<option value="Hiti">Haiti</option>
    		<option value="Hwi">Hawaii</option>
    		<option value="Hdrs">Honduras</option>
    		<option value="HK">Hong Kong</option>
    		<option value="Hngy">Hungary</option>
    		<option value="IL">Iceland</option>
    		<option value="Ind">India</option>
    		<option value="Inds">Indonesia</option>
    		<option value="Irn">Iran</option>
    		<option value="Irq">Iraq</option>
    		<option value="Irld">Ireland</option>
    		<option value="IslM">Isle of Man</option>
    		<option value="Isrl">Israel</option>
    		<option value="Ity">Italy</option>
    		<option value="Jmc">Jamaica</option>
    		<option value="Jpn">Japan</option>
    		<option value="Jrdn">Jordan</option>
    		<option value="Kzktn">Kazakhstan</option>
    		<option value="Kny">Kenya</option>
    		<option value="Krbt">Kiribati</option>
    		<option value="KorN">Korea North</option>
    		<option value="KorS">Korea South</option>
    		<option value="Kwt">Kuwait</option>
    		<option value="Kgzsn">Kyrgyzstan</option>
    		<option value="Laos">Laos</option>
    		<option value="Ltva">Latvia</option>
    		<option value="Lebn">Lebanon</option>
    		<option value="Lsth">Lesotho</option>
    		<option value="Lbra">Liberia</option>
    		<option value="Lby">Libya</option>
    		<option value="Ltsn">Liechtenstein</option>
    		<option value="Ltna">Lithuania</option>
    		<option value="Lux">Luxembourg</option>
    		<option value="Mcu">Macau</option>
    		<option value="Mcdn">Macedonia</option>
    		<option value="Mdgs">Madagascar</option>
    		<option value="Msia">Malaysia</option>
    		<option value="Mlwi">Malawi</option>
    		<option value="Mldv">Maldives</option>
    		<option value="Mali">Mali</option>
    		<option value="Mlt">Malta</option>
    		<option value="MarIs">Marshall Islands</option>
    		<option value="Martq">Martinique</option>
    		<option value="Mrtn">Mauritania</option>
    		<option value="Mrts">Mauritius</option>
    		<option value="Myte">Mayotte</option>
    		<option value="Mxc">Mexico</option>
    		<option value="MidIs">Midway Islands</option>
    		<option value="Mldv">Moldova</option>
    		<option value="Mnc">Monaco</option>
    		<option value="Mgla">Mongolia</option>
    		<option value="Mtsr">Montserrat</option>
    		<option value="Mrcc">Morocco</option>
    		<option value="Mzmb">Mozambique</option>
    		<option value="Mynm">Myanmar</option>
    		<option value="Nmba">Nambia</option>
    		<option value="Naru">Nauru</option>
    		<option value="Npl">Nepal</option>
    		<option value="NthAt">Netherland Antilles</option>
    		<option value="Ntlds">Netherlands (Holland, Europe)</option>
    		<option value="Nvs">Nevis</option>
    		<option value="NCale">New Caledonia</option>
    		<option value="NZea">New Zealand</option>
    		<option value="Nicg">Nicaragua</option>
    		<option value="Ngr">Niger</option>
    		<option value="Ngra">Nigeria</option>
    		<option value="Niue">Niue</option>
    		<option value="NorfIs">Norfolk Island</option>
    		<option value="Nrwy">Norway</option>
    		<option value="Oman">Oman</option>
    		<option value="Pkst">Pakistan</option>
    		<option value="PlIs">Palau Island</option>
    		<option value="Plst">Palestine</option>
    		<option value="Pnm">Panama</option>
    		<option value="PaNG">Papua New Guinea</option>
    		<option value="PaRG">Paraguay</option>
    		<option value="Peru">Peru</option>
    		<option value="Phlp">Philippines</option>
    		<option value="PtIs">Pitcairn Island</option>
    		<option value="Plnd">Poland</option>
    		<option value="Prgl">Portugal</option>
    		<option value="PtRc">Puerto Rico</option>
    		<option value="Qtr">Qatar</option>
    		<option value="ReMt">Republic of Montenegro</option>
    		<option value="ReSb">Republic of Serbia</option>
    		<option value="Rein">Reunion</option>
    		<option value="Rmn">Romania</option>
    		<option value="Rsa">Russia</option>
    		<option value="Rwnd">Rwanda</option>
    		<option value="SBat">St Barthelemy</option>
    		<option value="SEus">St Eustatius</option>
    		<option value="SHel">St Helena</option>
    		<option value="StKN">St Kitts-Nevis</option>
    		<option value="StLu">St Lucia</option>
    		<option value="StMa">St Maarten</option>
    		<option value="StPM">St Pierre and Miquelon</option>
    		<option value="StVG">St Vincent and Grenadines</option>
    		<option value="Sipn">Saipan</option>
    		<option value="Smo">Samoa</option>
    		<option value="SmoA">Samoa American</option>
    		<option value="SMar">San Marino</option>
    		<option value="SaTP">Sao Tome and Principe</option>
    		<option value="SaAr">Saudi Arabia</option>
    		<option value="Sngl">Senegal</option>
    		<option value="Sycl">Seychelles</option>
    		<option value="SieL">Sierra Leone</option>
    		<option value="Sgpr">Singapore</option>
    		<option value="Slvk">Slovakia</option>
    		<option value="Slvn">Slovenia</option>
    		<option value="SolIs">Solomon Islands</option>
    		<option value="Smla">Somalia</option>
    		<option value="StAf">South Africa</option>
    		<option value="Spn">Spain</option>
    		<option value="SrLk">Sri Lanka</option>
    		<option value="Sdn">Sudan</option>
    		<option value="Srnm">Suriname</option>
    		<option value="Swzl">Swaziland</option>
    		<option value="Swdn">Sweden</option>
    		<option value="Swzl">Switzerland</option>
    		<option value="Syr">Syria</option>
    		<option value="Thti">Tahiti</option>
    		<option value="Twn">Taiwan</option>
    		<option value="Tjks">Tajikistan</option>
    		<option value="Tnza">Tanzania</option>
    		<option value="Thld">Thailand</option>
    		<option value="Togo">Togo</option>
    		<option value="Tklu">Tokelau</option>
    		<option value="Tnga">Tonga</option>
    		<option value="TriT">Trinidad and Tobago</option>
    		<option value="Tnsa">Tunisia</option>
    		<option value="Trky">Turkey</option>
    		<option value="Tkst">Turkmenistan</option>
    		<option value="TuC">Turks and Caicos Is</option>
    		<option value="Tuvl">Tuvalu</option>
    		<option value="Ugnd">Uganda</option>
    		<option value="Ukr">Ukraine</option>
    		<option value="UAE">United Arab Emirates</option>
    		<option value="UK">United Kingdom</option>
    		<option value="USA">United States of America</option>
    		<option value="Urgy">Uruguay</option>
    		<option value="Uzbt">Uzbekistan</option>
    		<option value="Vnt">Vanuatu</option>
    		<option value="VCS">Vatican City State</option>
    		<option value="Vnzl">Venezuela</option>
    		<option value="Vtnm">Vietnam</option>
    		<option value="ViIsB">Virgin Islands (Brit)</option>
    		<option value="ViIsU">Virgin Islands (USA)</option>
    		<option value="WkIs">Wake Island</option>
    		<option value="WlF">Wallis and Futana Is</option>
    		<option value="Ymn">Yemen</option>
    		<option value="Zire">Zaire</option>
    		<option value="Zmba">Zambia</option>
    		<option value="Zmbw">Zimbabwe</option>
    	</select>		
    	<p> Mobile Phone : <input type="text" name="phone" size="15" maxlength="20"/></p>
    	<p><input type="submit" name="submit" value="Sign Up" /></p>
    	<br/>
    </form>
    </body>
    </html>
    
    <%
    
    if request.form("submit")  = "Sign Up" then
    
    cfname = request.form("fname")
    cuname = request.form("uname")
    cpswrd = request.form("pswrd")
    cemail = request.form("email")
    cgender = request.form("gender")
    cadd1 = request.form("add1")
    cadd2 = request.form("add2")
    ccity = request.form("city")
    czip = request.form("zip")
    ccountry = request.form("country")
    cphone = request.form("phone")
    
    sSQL = "Insert into Customer (Full_Name,[Username],[Password]," &_
    "Email,Gender,Address_Line_1,Address_Line_2," &_
    "City,Zip,Country,Phone_Number)" &_
    " values ('" & cfname & "','" & cuname & "','" & cpswrd & "'," &_
    "'" & cemail & "','" & cgender & "','" & cadd1 & "'," &_
    "'" & cadd2 & "','" & ccity & "'," & czip & "," &_
    "'" & ccountry & "','" & cphone & "')"
    
    Response.Write sSQL
    
    connection.Execute sSQL
    
    end if
    %>

  • #10
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    All you really need to do is make this change for each of your text data type inputs

    Code:
    Replace(request.form("fname"),"'","''")
    this will allow you to keep the apostrophe's that are used in the names but will not end the Input.

    Also before you go live remember to comment out where you wrote out the Insert string.

  • #11
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,589
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    Miranda is dead right. Ignore my senility.
    Last edited by Old Pedant; 12-15-2011 at 11:49 PM.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #12
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    ??? the function at the top of the page is VBScript and so is the if statement at the bottom of the page.

  • #13
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,589
    Thanks
    80
    Thanked 4,630 Times in 4,593 Posts
    LOL! Shame on me. I was looking at some other code at the same time and forgot which I was commenting on. DOH DOH DOH on me!
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #14
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by miranda View Post
    All you really need to do is make this change for each of your text data type inputs

    Code:
    Replace(request.form("fname"),"'","''")
    this will allow you to keep the apostrophe's that are used in the names but will not end the Input.

    Also before you go live remember to comment out where you wrote out the Insert string.
    okay, thanks a lot miranda!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •