?
Solved

Error with ID column in reference to ASP page

Posted on 2005-05-11
4
Medium Priority
?
333 Views
Last Modified: 2010-03-19
I am in the process of taking over hosting and maintenance of a website. The website utilizes ASP and an MSSQL  database. On the site there is a Membership Sign Up form. The purpose on our end of this form is to gather new member information into a table called members.asp  When the form is filled out and I click the submit button the following error appears:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'ID', table 'kidtiv12_kidsql.kidsql.members'; column does not allow nulls. INSERT fails.
/members_account.asp, line 117

Here’s a link to the page that I’m referring to
http://kidtiv12.win.aplus.net/members_account.asp

Actions I’ve taken to remedy the error.
•      Made sure the ID field has the ALLOW NULLS option unchecked
•      The data type is INT
•      The Identity column is set to YES…..(note, I also tried with the column set to YES(not for replication) )
•      The Identity Seed is set to 1
•      The Identity Increment is set to 1


Since the above error refers to line 117. Below is line 117.
conn.execute("insert into members (name, address1, address2, city, state, zip, phone, email, username, password, subcategories, towns, categories, IPaddress, membersince, visits) values ('" & fc(form("name")) & "','" & fc(form("address1")) & "','" & fc(form("address2")) & "','" & fc(form("city")) & "','" & fc(form("state")) & "','" & fc(form("zip")) & "','" & fc(form("phone")) & "','" & fc(form("email")) & "','" & fc(form("username")) & "','" & fc(form("password")) & "','" & subcategories & "','" & fc(form("towns")) & "','" & categories & "','" & request.servervariables("REMOTE_HOST") & "','" & date & "','1')")
The code below is the actual code for the page members.asp. For security puposes the SQL user name and password have been replaced with “*”
Can anyone guide me though this? This is a new client and we need get this up and running ASAP.
<!--#include file="functions.inc" -->

<% Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "DRIVER=SQL Server;server=winsql2.abac.com;uid=******;pwd=*******;database=kidtiv12_kidsql;"
conn.Open


username = true
password = true

if query("newmail") <> "" then
      conn.execute("insert into emails (email) values ('" & replace(fc(form("newmail"))," ","") & "')")
end if

if query("logout") <> "" then
      session("member") = "" 
      session("name") = "" 

elseif query("login") <> "" then
      set rsu = conn.execute("select * from members where username='" & fc(form("username")) & "'")
      if rsu.eof then
            username = false
       else
            set rsp = conn.execute("select * from members where username='" & fc(form("username")) & "' and password='" & fc(form("password")) & "'")
            if rsp.eof then
                  password = false
            else
                  session("name") = rsp("name")
                  session("member") = rsp("id")
                  visits = cint(rsp("visits")) + 1
                  conn.execute("update members set visits='" & visits & "' where id=" & rsp("id"))
            end if
      end if
end if

if query("password") <> "" and form("UserName") <> "" then
      Set rs = Conn.Execute("Select * from members where username='" & fc(form("UserName")) & "' or email='" & fc(form("UserName")) & "'")
      if not rs.eof then
            if rs("email") <> "" then
                  Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
                  Mailer.FromName = "Kidtivity.com"
                  Mailer.FromAddress= "info@kidtivity.com"
                  Mailer.ContentType = "text/html"
                  Mailer.RemoteHost = "www.kidtivity.com
                  Mailer.AddRecipient rs("name"),rs("email")
                  Mailer.Subject = "Your Kidtivity.com password"
                  Mailer.BodyText = "<html><body><font face=Arial size=2>Your username is: " & rs("username") & "<br>Your password is: " & rs("password") & "</font></body></html>"
                  Mailer.SendMail
            end if
            found = "Your password has been mailed."
      else
            inserterror = "Username or e-mail not found!"
      end if

elseif query("edit") <> "" and form("id") <> "" then
      if form("password") <> form("confirm") then
            inserterror = "Your passwords do not match"
      elseif form("name") = "" then
            inserterror = "Please enter your name."
      else
            categories = "" 
            subcategories = "" 
            choices = getInfo(form("subcategories"))
            count = cint(ubound(choices))
            for i = 0 to count
                  if choices(i,0) = "c" or choices(i,0) = " c" then
                        if categories = "" then
                              categories = "-" & choices(i,1) & "-"
                        else
                              categories = categories & ", -" & choices(i,1) & "-"
                        end if
                  else
                        if subcategories = "" then
                              subcategories = "-" & choices(i,1) & "-"
                        else
                              subcategories = subcategories & ", -" & choices(i,1) & "-"
                        end if
                  end if
            next
            sql = "update members set name='" & fc(form("name")) & "', address1='" & fc(form("address1")) & "', address2='" & fc(form("address2")) & "', city='" & fc(form("city")) & "', state='" & fc(form("state")) & "', zip='" & fc(form("zip")) & "', phone='" & fc(form("phone")) & "', email='" & fc(form("email")) & "', password='" & fc(form("password")) & "', subcategories='" & subcategories & "', categories='" & categories & "', towns='" & fc(form("towns")) & "', IPaddress='" & request.servervariables("REMOTE_HOST") & "' where id=" & form("id")
      conn.execute(sql)
      conn.execute("update emails set email='" & fc(form("email")) & "' where memberid=" & form("id"))
      'write("categories: " & len(categories))
      '            write("<br>subcategories: " & len(subcategories))
      '            write("<br>towns: " & len(form("towns")))
      sendto("members_login.asp?view=" & form("id"))
      end if

elseif query("new") <> "" and (form("name") <> "" or form("username") <> "") then
      if form("name") = "" then
            inserterror = "Please enter your name."
      elseif form("username") <> "" and form("password") <> "" then
            set rsc = conn.execute("select id from members where username='" & fc(form("username")) & "'")
            if rsc.eof then
                  categories = "" 
            subcategories = "" 
            choices = getInfo(form("subcategories"))
            count = cint(ubound(choices))
            for i = 0 to count
                  if choices(i,0) = "c" or choices(i,0) = " c" then
                        if categories = "" then
                              categories = "-" & choices(i,1) & "-"
                        else
                              categories = categories & ", -" & choices(i,1) & "-"
                        end if
                  else
                        if subcategories = "" then
                              subcategories = "-" & choices(i,1) & "-"
                        else
                              subcategories = subcategories & ", -" & choices(i,1) & "-"
                        end if
                  end if
            next
                  'write("categories: " & len(categories))
                  'write("<br>subcategories: " & len(subcategories))
                  'write("<br>towns: " & len(form("towns")))
                  conn.execute("insert into members (name, address1, address2, city, state, zip, phone, email, username, password, subcategories, towns, categories, IPaddress, membersince, visits) values ('" & fc(form("name")) & "','" & fc(form("address1")) & "','" & fc(form("address2")) & "','" & fc(form("city")) & "','" & fc(form("state")) & "','" & fc(form("zip")) & "','" & fc(form("phone")) & "','" & fc(form("email")) & "','" & fc(form("username")) & "','" & fc(form("password")) & "','" & subcategories & "','" & fc(form("towns")) & "','" & categories & "','" & request.servervariables("REMOTE_HOST") & "','" & date & "','1')")
                  set rsg = conn.execute("select id, email, name from members where username='" & fc(form("username")) & "' and password='" & fc(form("password")) & "'")
                  conn.execute("insert into emails (email, memberid) values ('" & rsg("email") & "','" & rsg("id") & "')")
                  session("member") = rsg("id")
                  session("name") = rsg("name")
                  sendto("members_login.asp?view=" & form("id"))
            else
                  inserterror = "Sorry, that username is already taken, please try another one."
            end if
            rsc.close
            set rsc = nothing
      else
            inserterror = "You did not enter in a username and/or password!"
      end if
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

      <head>
            <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
            <meta name="keywords" content="find activities, farmington valley, central Connecticut, families, sports">
            <meta name="description" content="Become a member of Kidtivity.com to easily find, sign up for and manage cool activities, events, and classes for CT families.">
            <meta name="revisit-after" content="60 days">
            <meta name="robots" content="all">
            <meta name="copyright" content="This document &copy; 2004 by Kidtivity.com. All rights reserved worldwide.">
            <meta name="publisher" content="Trimerous">
            <meta name="author" content="Kidtivity.com">
            <title>Kidtivity.com - Greater Hartford CT, fun activities, children's programs</title>
            <script><!--
img1 = new Image;
img1.src = "pix/nav_about_on.gif";
img2 = new Image;
img2.src = "pix/nav_find_on.gif";
img3 = new Image;
img3.src = "pix/nav_members_on.gif";
img4 = new Image;
img4.src = "pix/nav_list_on.gif";
img5 = new Image;
img5.src = "pix/nav_contact_on.gif";

function rollover(target,imgName) {
      if (document.images) {
            imgchange = 'pix/' + imgName;
            document[target].src = imgchange;
            }
}

// --></script>
            <link href="master.css" rel="stylesheet">
      </head>

      <body class="body" bgcolor="#cde5ef" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
            <!-- find activities, farmington valley, central Connecticut, families, sports bf-->
            <table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
                  <tr>
                        <td colspan="4" valign="bottom" bgcolor="white" width="749" background="pix/pix_50_trans.gif"><img src="pix/pix_trans.gif" height="20" width="1" border="0"></td>
                  </tr>
                  <tr>
                        <td valign="bottom" bgcolor="white" width="20" background="pix/pix_50_trans.gif"><img src="pix/pix_trans.gif" height="1" width="20" border="0"></td>
                        <td valign="top" bgcolor="white" width="142" background="pix/pix_50_trans.gif">
                              <table width="142" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                          <td valign="top" width="142"><a href="index.asp"><img src="pix/g_logo1.gif" alt="Kidtivity Logo" height="83" width="142" border="0"></a></td>
                                    </tr>
                                    <tr>
                                          <td valign="top" bgcolor="white" width="142" background="pix/pix_50_trans.gif"><a onmouseover="rollover('about','nav_about_on.gif');" onmouseout="rollover('about','nav_about_off.gif');" href="about.asp"><img src="pix/nav_about_off.gif" alt="About Kidtivity" name="about" height="24" width="142" border="0"></a><a onmouseover="rollover('find','nav_find_on.gif');" onmouseout="rollover('find','nav_find_off.gif');" href="find.asp"><img src="pix/nav_find_off.gif" alt="Find Activities" name="find" height="24" width="142" border="0"></a><a href="members.asp"><img src="pix/nav_members_on.gif" alt="Free Membership" name="members" height="24" width="142" border="0"></a><table width="100%" border="0" cellspacing="1" cellpadding="2" background="pix/pix_50_trans.gif">
                                                      <% if session("member") <> "" then %>
                                                      <tr>
                                                            <td bgcolor="cde5ef"><img src="pix/g_arrowright.gif" height="7" width="4" border="0" hspace="2"><a class="subnav" href='members.asp?edit=<%= session("member") %>'>Profile</a></td>
                                                      </tr>
                                                      <tr>
                                                            <td bgcolor="cde5ef"><img src="pix/g_arrowright.gif" height="7" width="4" border="0" hspace="2"><a class="subnav" href='members_kids.asp?member=<%= session("member") %>'>Kids</a></td>
                                                      </tr>
                                                      <tr>
                                                            <td bgcolor="cde5ef"><img src="pix/g_arrowright.gif" height="7" width="4" border="0" hspace="2"><a class="subnav" href='members_bookmarks.asp?member=<%= session("member") %>'>Saved Activities</a></td>
                                                      </tr>
                                                      <tr>
                                                            <td bgcolor="cde5ef"><img src="pix/g_arrowright.gif" height="7" width="4" border="0" hspace="2"><a class="subnav" href='members_registered.asp?member=<%= session("member") %>'>Registered Activities</a></td>
                                                      </tr>
                                                      <% end if %>
                                                </table>
                                                <a onmouseover="rollover('list','nav_list_on.gif');" onmouseout="rollover('list','nav_list_off.gif');" href="list.asp"><img src="pix/nav_list_off.gif" alt="Advertise with Us" name="list" height="24" width="142" border="0"></a><a onmouseover="rollover('contact','nav_contact_on.gif');" onmouseout="rollover('contact','nav_contact_off.gif');" href="contact.asp"><img src="pix/nav_contact_off.gif" alt="Contact Us" name="contact" height="25" width="142" border="0"></a><br>
                                                <br>
                                                <br>
                                                <!-- <table class="callout" width="135" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<div align="center">
<br>
<img src="pix/g_newl_blue.gif" alt="" height="60" width="125" border="0"><br>
<% if query("newmail") = "" then %>
<form action="members_account.asp?newmail=true&password=<%= query("password") %>&new=<%= query("new") %>&edit=<%= query("edit") %>" method="post">
<input type="text" name="newmail" size="15" border="0"><br>
<input type="image" src="pix/b_submit_grn.gif" alt="Submit" border="0"><br>
</form>
<% else %>
<br>Thank you!<br><br>
<% end if %>
</div>
</td>
</tr>
</table> --></td>
                                    </tr>
                              </table>
                              <br>
                        </td>
                        <td valign="top" bgcolor="white" width="567" background="pix/pix_50_trans.gif">
                              <table width="567" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                          <td align="left" valign="top" bgcolor="#003366" width="3" background="pix/pix_50_trans.gif"><img src="/pix/g_header.gif" alt="The Parents Site for Local Kids Activities" height="22" width="239" border="0" hspace="3"></td>
                                          <td align="right" valign="top" bgcolor="#003366" background="pix/pix_50_trans.gif"><a href="index.asp"><img src="pix/b_home.gif" alt="Home" height="22" width="40" border="0"></a><a href="sitemap.html"><img src="pix/b_sitemap.gif" alt="Sitemap" height="22" width="79" border="0"></a></td>
                                    </tr>
                                    <tr>
                                          <td colspan="2" align="left" valign="top"><a href="index.asp"><img src="pix/g_logo2.gif" height="61" width="194" border="0" hspace="3"></a></td>
                                    </tr>
                              </table>
                              <table border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                          <td valign="top" width="3" background="pix/bg_cross.gif"><img src="pix/pix_trans.gif" height="300" width="3" border="0"></td>
                                          <td width="10"><img src="pix/pix_trans.gif" height="1" width="10" border="0"></td>
                                          <td valign="top" width="100%"><img src="pix/st_members.gif" alt="Members" height="20" width="117" border="0"><br>
                                                <% if query("password") <> "" then %>
                                                <p>To have your password emailed to the email address you specified when you first signed up, please enter your username or email below.</p>
                                                <p></p>
                                                <form action="members_account.asp?password=true" method="post">
                                                      <input type="text" name="UserName" size="25">
                                                      <p><input style="background-color:cde5ef; font-size:12px" type="submit" value="Get Password"></p>
                                                </form>
                                                <%       if inserterror <> "" then
            write("<b>" & inserterror & "</b>")
      elseif found <> "" then %><%= found %>
                                                <p><img src="pix/b_arrow.gif" height="9" width="5" border="0" hspace="2"><a class="link" href="find.asp">Search for activities</a> <%      end if

elseif query("edit") <> "" or query("new") <> "" then %><br>
                                                      View our: <img src="pix/g_arrowright.gif" height="7" width="4" border="0" hspace="2"><a class="link" href="privacy.asp">Privacy Policy</a>&nbsp;&nbsp;<img src="pix/g_arrowright.gif" height="7" width="4" border="0" hspace="2"><a class="link" href="terms.asp">Terms of Service</a></p>
                                                <p>Please fill in the following information:<br>
                                                      <%      if query("edit") <> "" then
            set rsedit = conn.execute("select * from members where id=" & query("edit"))
      end if
      if inserterror <> "" then %><br>
                                                      <font color="red"><b><%= inserterror %></b><br>
                                                            <br>
                                                      </font><%       end if %></p>
                                                <form action='members_account.asp?new=<%= query("new") %>&edit=<%= query("edit") %>' method="post">
                                                      <input type="hidden" name="id" value='<%= query("edit") %>'>
                                                      <table width="100%" border="0" cellspacing="1" cellpadding="2">
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white" width="20%">Parent(s) Name</td>
                                                                  <td><input type="text" name="name" value='<%= check("name") %>' size="30" maxlength="100"></td>
                                                            </tr>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">Address1</td>
                                                                  <td><input type="text" name="address1" value='<%= check("address1") %>' size="30" maxlength="100"></td>
                                                            </tr>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">Address2</td>
                                                                  <td><input type="text" name="address2" value='<%= check("address2") %>' maxlength="100"></td>
                                                            </tr>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">City</td>
                                                                  <td><input type="text" name="city" value='<%= check("city") %>' maxlength="50"></td>
                                                            </tr>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">State</td>
                                                                  <td><select style="font-size: 11px; font-family:Arial;" name="state" size="1">
                                                                              <option value=""></option>
                                                                              <option value="AL" <% if check("state") = "AL" then %> selected<% end if %>>AL</option>
                                                                              <option value="AK" <% if check("state") = "AK" then %> selected<% end if %>>AK</option>
                                                                              <option value="AZ" <% if check("state") = "AZ" then %> selected<% end if %>>AZ</option>
                                                                              <option value="AR" <% if check("state") = "AR" then %> selected<% end if %>>AR</option>
                                                                              <option value="CA" <% if check("state") = "CA" then %> selected<% end if %>>CA</option>
                                                                              <option value="CO" <% if check("state") = "CO" then %> selected<% end if %>>CO</option>
                                                                              <option value="CT" <% if check("state") = "CT" or query("new") <> "" then %> selected<% end if %>>CT</option>
                                                                              <option value="DC" <% if check("state") = "DC" then %> selected<% end if %>>DC</option>
                                                                              <option value="DE" <% if check("state") = "DE" then %> selected<% end if %>>DE</option>
                                                                              <option value="FL" <% if check("state") = "FL" then %> selected<% end if %>>FL</option>
                                                                              <option value="GA" <% if check("state") = "GA" then %> selected<% end if %>>GA</option>
                                                                              <option value="HI" <% if check("state") = "HI" then %> selected<% end if %>>HI</option>
                                                                              <option value="IA" <% if check("state") = "IA" then %> selected<% end if %>>IA</option>
                                                                              <option value="ID" <% if check("state") = "ID" then %> selected<% end if %>>ID</option>
                                                                              <option value="IL" <% if check("state") = "IL" then %> selected<% end if %>>IL</option>
                                                                              <option value="IN" <% if check("state") = "IN" then %> selected<% end if %>>IN</option>
                                                                              <option value="KS" <% if check("state") = "KS" then %> selected<% end if %>>KS</option>
                                                                              <option value="KY" <% if check("state") = "KY" then %> selected<% end if %>>KY</option>
                                                                              <option value="LA" <% if check("state") = "LA" then %> selected<% end if %>>LA</option>
                                                                              <option value="MA" <% if check("state") = "MA" then %> selected<% end if %>>MA</option>
                                                                              <option value="ME" <% if check("state") = "ME" then %> selected<% end if %>>ME</option>
                                                                              <option value="MD" <% if check("state") = "MD" then %> selected<% end if %>>MD</option>
                                                                              <option value="MI" <% if check("state") = "MI" then %> selected<% end if %>>MI</option>
                                                                              <option value="MN" <% if check("state") = "MN" then %> selected<% end if %>>MN</option>
                                                                              <option value="MO" <% if check("state") = "MO" then %> selected<% end if %>>MO</option>
                                                                              <option value="MS" <% if check("state") = "MS" then %> selected<% end if %>>MS</option>
                                                                              <option value="MT" <% if check("state") = "MT" then %> selected<% end if %>>MT</option>
                                                                              <option value="NC" <% if check("state") = "NC" then %> selected<% end if %>>NC</option>
                                                                              <option value="ND" <% if check("state") = "ND" then %> selected<% end if %>>ND</option>
                                                                              <option value="NE" <% if check("state") = "NE" then %> selected<% end if %>>NE</option>
                                                                              <option value="NH" <% if check("state") = "NH" then %> selected<% end if %>>NH</option>
                                                                              <option value="NJ" <% if check("state") = "NJ" then %> selected<% end if %>>NJ</option>
                                                                              <option value="NM" <% if check("state") = "NM" then %> selected<% end if %>>NM</option>
                                                                              <option value="NV" <% if check("state") = "NV" then %> selected<% end if %>>NV</option>
                                                                              <option value="NY" <% if check("state") = "NY" then %> selected<% end if %>>NY</option>
                                                                              <option value="OH" <% if check("state") = "OH" then %> selected<% end if %>>OH</option>
                                                                              <option value="OK" <% if check("state") = "OK" then %> selected<% end if %>>OK</option>
                                                                              <option value="OR" <% if check("state") = "OR" then %> selected<% end if %>>OR</option>
                                                                              <option value="PA" <% if check("state") = "PA" then %> selected<% end if %>>PA</option>
                                                                              <option value="RI" <% if check("state") = "RI" then %> selected<% end if %>>RI</option>
                                                                              <option value="SC" <% if check("state") = "SC" then %> selected<% end if %>>SC</option>
                                                                              <option value="SD" <% if check("state") = "SD" then %> selected<% end if %>>SD</option>
                                                                              <option value="TN" <% if check("state") = "TN" then %> selected<% end if %>>TN</option>
                                                                              <option value="TX" <% if check("state") = "TX" then %> selected<% end if %>>TX</option>
                                                                              <option value="UT" <% if check("state") = "UT" then %> selected<% end if %>>UT</option>
                                                                              <option value="VA" <% if check("state") = "VA" then %> selected<% end if %>>VA</option>
                                                                              <option value="VT" <% if check("state") = "VT" then %> selected<% end if %>>VT</option>
                                                                              <option value="WA" <% if check("state") = "WA" then %> selected<% end if %>>WA</option>
                                                                              <option value="WI" <% if check("state") = "WI" then %> selected<% end if %>>WI</option>
                                                                              <option value="WV" <% if check("state") = "WV" then %> selected<% end if %>>WV</option>
                                                                              <option value="WY" <% if check("state") = "WY" then %> selected<% end if %>>WY </option>
                                                                        </select></td>
                                                            </tr>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">Zip code</td>
                                                                  <td><input type="text" name="zip" value='<%= check("zip") %>' maxlength="15"></td>
                                                            </tr>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">Phone</td>
                                                                  <td><input type="text" name="phone" value='<%= check("phone") %>' maxlength="50"></td>
                                                            </tr>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">E-mail</td>
                                                                  <td><input type="text" name="email" value='<%= check("email") %>' maxlength="100"></td>
                                                            </tr>
                                                            <% if query("edit") = "" then %>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">Username</td>
                                                                  <td><input type="text" name="username" value='<%= check("username") %>' maxlength="50"></td>
                                                            </tr>
                                                            <% end if %>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">Password</td>
                                                                  <td><input type="password" name="password" value='<%= check("password") %>' maxlength="50"></td>
                                                            </tr>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">Confirm Password</td>
                                                                  <td><input type="password" name="confirm" value='<%= check("password") %>' maxlength="50"></td>
                                                            </tr>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white"></td>
                                                                  <td class="bodysm">Select the following below if you would like to<br>
                                                                        be notified when new activities have been added<br>
                                                                        in your activities or towns of interest.</td>
                                                            </tr>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">Activities of Interest</td>
                                                                  <td>
                                                                        <table border="0" cellspacing="0" cellpadding="0">
                                                                              <tr>
                                                                                    <td><select style="background-color:cde5ef" name="subcategories" size="5" multiple>
                                                                                                <option value="">No Activities</option>
                                                                                                <option value="">--------------- <% set rsc = conn.execute("select * from categories order by category")
                  if not rsc.eof then
                  do while not rsc.eof %></option>
                                                                                                <option value='-c:<%= rsc("id") %>-' <% if instr(check("categories"),"-" & rsc("id") & "-") <> 0 then %> selected<% end if %>><b><%= rsc("category") %></b> <%            set rss = conn.execute("select * from subcategories where categoryid=" & rsc("id") & " order by subcategory")
                        if not rss.eof then
                              do while not rss.eof %></option>
                                                                                                <option value='-s:<%= rss("id") %>-' <% if instr(check("subcategories"),"-" & rss("id") & "-") <> 0 then %> selected<% end if %>>&nbsp;&nbsp;- <%= rss("subcategory") %> <%                         rss.movenext
                              loop
                        end if
                        rss.close
                        set rss = nothing
                        rsc.movenext
                  loop
                  rsc.close
                  set rsc = nothing
                  end if %></option>
                                                                                          </select></td>
                                                                                    <td width="10"><img src="pix/pix_trans.gif" height="1" width="10" border="0"></td>
                                                                                    <td class="bodysm">To select multiple<br>
                                                                                          categories/subcategories<br>
                                                                                          hold &lt;ctrl&gt; and click.</td>
                                                                              </tr>
                                                                        </table>
                                                                  </td>
                                                            </tr>
                                                            <tr>
                                                                  <td class="body" align="right" bgcolor="white">Towns of Interest</td>
                                                                  <td>
                                                                        <table border="0" cellspacing="0" cellpadding="0">
                                                                              <tr>
                                                                                    <td><select style="background-color:cde5ef" name="towns" size="5" multiple>
                                                                                                <option value="">No Towns</option>
                                                                                                <option value="">--------------- <% set rst = conn.execute("select * from towns order by town")
                      do while not rst.eof %></option>
                                                                                                <option value='-<%= rst("id") %>-' <% if instr(check("towns"),"-" & rst("id") & "-") <> 0 then %> selected<% end if %>><%= replace(rst("town"),"zMass","Mass") %> <%       rst.movenext
                     loop
                     rst.close
                     set rst = nothing %></option>
                                                                                          </select></td>
                                                                                    <td width="10"><img src="pix/pix_trans.gif" height="1" width="10" border="0"></td>
                                                                                    <td class="bodysm">To select multiple towns<br>
                                                                                          hold &lt;ctrl&gt; and click.</td>
                                                                              </tr>
                                                                        </table>
                                                                  </td>
                                                            </tr>
                                                            <tr>
                                                                  <td align="right" bgcolor="white"><input style="background-color:cde5ef; font-size:12px" type="submit" value='<% if query("edit") <> "" then %>Update<% else %>Create<% end if %> Profile'></td>
                                                                  <td><input style="background-color:cde5ef; font-size:12px" onclick="history.back();" type="button" value="Cancel"></td>
                                                            </tr>
                                                      </table>
                                                </form>
                                                <% if query("edit") <> "" then
      rsedit.close
      set rsedit = nothing
   end if
 end if
%><!-- stop putting stuff here --></td>
                                    </tr>
                              </table>
                        </td>
                        <td align="right" valign="bottom" bgcolor="white" width="20" background="pix/pix_50_trans.gif"><img src="pix/pix_trans.gif" height="1" width="20" border="0"></td>
                  </tr>
                  <tr>
                        <td valign="bottom" bgcolor="white" width="20" background="pix/pix_50_trans.gif"><img src="pix/g_bcurve_l.gif" height="18" width="20" border="0"></td>
                        <td colspan="2" valign="top" bgcolor="white" width="769" background="pix/pix_50_trans.gif"><img src="pix/pix_trans.gif" height="20" width="1" border="0"></td>
                        <td align="right" valign="bottom" bgcolor="white" width="20" background="pix/pix_50_trans.gif"><img src="pix/g_bcurve_r.gif" height="18" width="20" border="0"></td>
                  </tr>
            </table>
            <table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
                  <tr>
                        <td>
                              <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
                                    <tr>
                                          <td class="bodysm" align="left" valign="top" width="0%"><img src="pix/pix_trans.gif" height="1" width="20" border="0"></td>
                                          <td class="bodysm" align="left" valign="top" width="60%"><br>
                                                <a class="link" href="about.asp">About Kidtivity</a> | <a class="link" href="find.asp">Find Activities</a> | <a class="link" href="members.asp">Free Membership</a> | <a class="link" href="list.asp">List Your Activities</a> | <a class="link" href="contact.asp">Contact Us</a></td>
                                          <td class="bodysm" align="right" valign="top" width="40%"><br>
                                                <font color="#003366">&copy; 2004 kidtivity.com | <a class="link" href="terms.asp">Terms Of Service</a> | <a class="link" href="privacy.asp">Privacy Policy</a><br>
                                                      Website Design by <a class="link" href="http://www.trimerous.com">Trimerous</a></font></td>
                                          <td class="bodysm" align="right" valign="top" width="0%"><img src="pix/pix_trans.gif" height="1" width="20" border="0"></td>
                                    </tr>
                              </table>
                        </td>
                  </tr>
            </table>
      </body>

      <% if username = false then %>
      <script>
            alert("Username not found!")
      </script>
      <% elseif password = false then %>
      <script>
            alert("Incorrect Password!")
      </script>
      <% end if %>

</html>

<% conn.close
set conn = nothing %>
0
Comment
Question by:jansson17
  • 2
4 Comments
 
LVL 28

Expert Comment

by:rafrancisco
ID: 13978548
Can you please post the definition of your 'kidtiv12_kidsql.kidsql.members' table.
0
 

Author Comment

by:jansson17
ID: 13979547
Is this what you mean?

BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_members
      (
      ID int NOT NULL IDENTITY (1, 1),
      Name varchar(100) NULL,
      Address1 varchar(100) NULL,
      Address2 varchar(50) NULL,
      city varchar(50) NULL,
      state varchar(2) NULL,
      zip varchar(15) NULL,
      email varchar(100) NULL,
      username varchar(50) NULL,
      password varchar(50) NULL,
      towns varchar(1150) NULL,
      subcategories varchar(1000) NULL,
      categories varchar(255) NULL,
      phone varchar(50) NULL,
      IPaddress varchar(50) NULL,
      memberSince datetime NULL,
      visits varchar(10) NULL
      )  ON [PRIMARY]
GO
SET IDENTITY_INSERT dbo.Tmp_members ON
GO
IF EXISTS(SELECT * FROM dbo.members)
       EXEC('INSERT INTO dbo.Tmp_members (ID, Name, Address1, Address2, city, state, zip, email, username, password, towns, subcategories, categories, phone, IPaddress, memberSince, visits)
            SELECT ID, Name, Address1, Address2, city, state, zip, email, username, password, towns, subcategories, categories, phone, IPaddress, memberSince, visits FROM dbo.members TABLOCKX')
GO
SET IDENTITY_INSERT dbo.Tmp_members OFF
GO
DROP TABLE dbo.members
GO
EXECUTE sp_rename N'dbo.Tmp_members', N'members', 'OBJECT'
GO
COMMIT
0
 
LVL 28

Accepted Solution

by:
rafrancisco earned 2000 total points
ID: 13980089
Can you try issuing this in Query Analyzer:

SET IDENTITY_INSERT dbo.members OFF

or this

SET IDENTITY_INSERT kidsql.Tmp_members OFF

Then try running your application again.
0
 
LVL 19

Expert Comment

by:Melih SARICA
ID: 13987177
u set column ID as Not null but ur not inserting this columns value with ur insert statement..

set ID column as Identity . this ll generate an identity value for this column for every row..


Melih SARICA
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

864 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