<form id="hz9zz"></form>
  • <form id="hz9zz"></form>

      <nobr id="hz9zz"></nobr>

      <form id="hz9zz"></form>

    1. 明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

      如何用最容易的語句提交大量表單對象的值存儲到數據庫

      [摘要]如何用最簡單的語句提交大量表單對象的值存儲到數據庫?說道這個問題可能大家經常遇到,感到很頭痛,但是又沒辦法,只能慢慢寫,筆者以提交一張應聘表單的提交為例給大家介紹如何用最簡短的語句來達到目的 腳本運行通過環境環境: iis5.0+sqlserver2000(當然也可以access2000等) 如有...

      如何用最簡單的語句提交大量表單對象的值存儲到數據庫?說道這個問題可能大家經常遇到,感到很頭痛,但是又沒辦法,只能慢慢寫,筆者以提交一張應聘表單的提交為例給大家介紹如何用最簡短的語句來達到目的
      腳本運行通過環境環境:
      iis5.0+sqlserver2000(當然也可以access2000等)

      如有任何問題或建議請發email:chenxingbai@21cn.com
      生成表結構的腳本
      if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[yingpin]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
      drop table [dbo].[yingpin]
      GO

      CREATE TABLE [dbo].[yingpin] (
      [id] [int] IDENTITY (1, 1) NOT NULL ,
      [yp_ name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
      [sex] [varchar] (4) COLLATE Chinese_PRC_CI_AS NULL ,
      [birthday] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
      [health] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
      [hunyin] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
      [zhengzhi] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
      [xueli] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
      [zhicheng] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
      [english] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
      [email] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
      [phone] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
      [yp_ address] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
      [zip] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
      [colledge] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
      [zhuanye] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
      [bumen] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
      [gangwei1] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
      [gangwei2] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
      [x_shijian] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [x_address] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [x_zhiwu] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [g_shijian] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [g_address] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [g_zhiwu] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [h_name] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [h_guanxi] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [h_danwei] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [h_zhiwu] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [pingjia] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [shexiang] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [beizhu] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
      [shijian] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
      ) ON [PRIMARY]
      GO

      ALTER TABLE [dbo].[yingpin] WITH NOCHECK ADD
      CONSTRAINT [DF_yingpin_shijian] DEFAULT (getdate()) FOR [shijian],
      CONSTRAINT [PK_yingpin] PRIMARY KEY CLUSTERED
      (
      [id]
      ) ON [PRIMARY]
      GO


      Asp腳本addyp.asp



      <!--#include file="lib/config1.asp"-->
      <%
      if request("action")="add" then
      dim str,strvalue,strname,i,str1
      str="yp_name,sex,birthday,health,hunyin,zhengzhi,xueli,zhicheng,english,email,phone,yp_address,zip,colledge,zhuanye,bumen,gangwei1,gangwei2,x_shijian,x_address,x_zhiwu,g_shijian,g_address,g_zhiwu,h_name,h_guanxi,h_danwei,h_zhiwu,pingjia,shexiang,beizhu"
      str1="x_shijian,x_address,x_zhiwu,g_shijian,g_address,g_zhiwu,h_name,h_guanxi,h_danwei,h_zhiwu"
      strname=split(str,",")

      for i=lbound(strname) to ubound(strname)
      if i<>ubound(strname) then
      if instr(str1,strname(i))=0 then
      if trim(request.Form(strname(i)))="" then
      response.write "<script>alert('發生錯誤,請將數據填寫完整!');history.back(1);</script>"
      response.End()
      end if
      sql=sql&"'"&trim(request.Form(strname(i)))&"',"
      else
      j=1
      much=trim(request.Form(cstr(strname(i)&j)))
      for j=2 to 5
      much=much&" "&trim(request.Form(cstr(strname(i)&j)))
      next
      sql=sql&"'"&much&"',"
      end if
      else
      if trim(request.Form(strname(i)))="" then
      response.write "<script>alert('發生錯誤,請將數據填寫完整!');history.back(1);</script>"
      response.End()
      end if
      sql=sql&"'"&trim(request.Form(strname(i)))&"'"
      end if
      next
      sql="insert into yingpin ("&str&") values ("&sql&")"

      conn.Execute(Sql)
      if Err <> 0 Then
      response.write "<script>alert('發生錯誤,請重新操作!');history.back(1);</script>"

      else
      response.write "<script>alert('已經成功提交應聘信息,\n我們會盡快和你聯系!');window.location='addyp.asp';</script>"

      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=gb2312">
      <title>gsjj</title>
      <link type="text/css" rel="stylesheet" href="main.css">
      </head>

      <body bgcolor="#0066CC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="background-attachment:fixed;">

      <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
      <td align="center" valign="top" class="gray">
      <p align="center"><font color="#66FF00">:::::::誠邀加盟:::::::</font></p>
      <form action="addyp.asp?action=add" method="post" name="ts">

      <table width=100% border=1 align="center" cellpadding=0 cellspacing="0" bordercolorlight="#000000" bordercolordark="#ffffff">
      <tbody>
      <tr>
      <td height="35" colspan="5"><font color="#FFFFFF"><span
      id=fps7>姓 名
      <input
      name="name" onFocus="this.select()"
      onMouseOver="this.focus()" size="12"
      >
      <font color="#FF0000"> *</font> 性別
      <input
      name="sex" onFocus="this.select()"
      onMouseOver="this.focus()" size="4"

      type=text>
      <font color="#FF0000">*</font>出生年月
      <input name="birthday"
      type=text id="birthday"
      onFocus="this.select()"
      onMouseOver="this.focus()" size="16"
      >
      <font color="#FF0000">*</font> </span></font></td>
      </tr>
      <tr>
      <td height="36" colspan="5"><font color="#FFFFFF"><span
      id=fps7>健康狀況
      <input
      name="health" onFocus="this.select()"
      onMouseOver="this.focus()" size="8"
      >
      <font color="#FF0000">*</font> 婚姻狀況
      <input
      name="hunyin" onFocus="this.select()"
      onMouseOver="this.focus()" size="6"

      type=text>
      <font color="#FF0000">*</font> 政治面貌
      <input
      name="zhengzhi" onFocus="this.select()"
      onMouseOver="this.focus()" size="16"

      type=text>
      <font color="#FF0000">*</font> </span></font></td>
      </tr>
      <tr>
      <td height="34" colspan="5"><font color="#FFFFFF">最高學歷<span id=fps7>
      <input
      name="xueli" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      <font color="#FF0000">*</font>職稱
      <input
      name="zhicheng" onFocus="this.select()"
      onMouseOver="this.focus()" size="8"

      type=text>
      <font color="#FF0000">*</font>外語水平
      <input
      name="english" onFocus="this.select()"
      onMouseOver="this.focus()" size="16"

      type=text>
      <font color="#FF0000">*</font> </span></font></td>
      </tr>
      <tr>
      <td height="30" colspan="5"><font color="#FFFFFF">E - MAIL<span id=fps7>
      <input
      name="email" onFocus="this.select()"
      onMouseOver="this.focus()" size="30"
      >
      <font color="#FF0000">*</font>電話
      <input
      name="phone" onFocus="this.select()"
      onMouseOver="this.focus()" size=16
      >
      <font color="#FF0000">*</font> </span></font></td>
      </tr>
      <tr>
      <td height="28" colspan="5" valign="middle"> <font color="#FFFFFF"><span id=fps7>聯系地址</span><span id=fps7>
      <input
      name="address" onFocus="this.select()"
      onMouseOver="this.focus()" size="30"
      >
      <font color="#FF0000">*</font>郵政編碼
      <input
      name="zip" onFocus="this.select()"
      onMouseOver="this.focus()" size="16"

      type=text>
      <font color="#FF0000">*</font> </span></font></td>
      </tr>
      <tr>
      <td height="29" colspan="5"><font color="#FFFFFF"> <span
      id=fps7>畢業院校
      <input
      name="colledge" onFocus="this.select()"
      onMouseOver="this.focus()" size="30"
      >
      <font color="#FF0000">*</font>專業
      <input
      name="zhuanye" onFocus="this.select()"
      onMouseOver="this.focus()" size=16
      >
      <font color="#FF0000">*</font> </span></font></td>
      </tr>
      <tr>
      <td height="27" colspan="5"><font color="#FFFFFF">應聘部門<span
      id=fps7>
      <input
      name="bumen" onFocus="this.select()"
      onMouseOver="this.focus()" size=10
      >
      </span><span
      id=fps7><font color="#FF0000">*</font></span>應聘崗位<span
      id=fps7>
      <input
      name="gangwei1" onFocus="this.select()"
      onMouseOver="this.focus()" size=12
      >
      </span><span
      id=fps7><font color="#FF0000">*</font></span>第二應聘崗位<span
      id=fps7>
      <input
      name="gangwei2" onFocus="this.select()"
      onMouseOver="this.focus()" size=12
      >
      <font color="#FF0000">*</font> </span></font></td>
      </tr>
      <tr>
      <td width="5%" height="203" rowspan="6" align="center" valign="middle"><font color="#FFFFFF">學<br>
      <br>
      習<br>
      <br>
      經<br>
      <br>
      歷 </font></td>
      <td height="25" colspan="4"><font color="#FFFFFF">起止時間學校
      職務</font></td>
      </tr>
      <tr align="center">
      <td colspan="4" align="left"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="x_shijian1" onFocus="this.select()"
      onMouseOver="this.focus()" size="18"
      >

      <input
      name="x_address1" onFocus="this.select()"
      onMouseOver="this.focus()" size="20"
      >

      <input
      name="x_zhiwu1" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td colspan="4" align="left"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="x_shijian2" onFocus="this.select()"
      onMouseOver="this.focus()" size="18"
      >

      <input
      name="x_address2" onFocus="this.select()"
      onMouseOver="this.focus()" size="20"
      >

      <input
      name="x_zhiwu2" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td colspan="4" align="left"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="x_shijian3" onFocus="this.select()"
      onMouseOver="this.focus()" size="18"
      >

      <input
      name="x_address3" onFocus="this.select()"
      onMouseOver="this.focus()" size="20"
      >

      <input
      name="x_zhiwu3" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td colspan="4" align="left"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="x_shijian4" onFocus="this.select()"
      onMouseOver="this.focus()" size="18"
      >

      <input
      name="x_address4" onFocus="this.select()"
      onMouseOver="this.focus()" size="20"
      >

      <input
      name="x_zhiwu4" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td colspan="4" align="left"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="x_shijian5" onFocus="this.select()"
      onMouseOver="this.focus()" size="18"
      >

      <input
      name="x_address5" onFocus="this.select()"
      onMouseOver="this.focus()" size="20"
      >

      <input
      name="x_zhiwu5" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr>
      <td colspan="5">
      </tbody>
      <tr>
      <td height="203" rowspan="6" align="center" valign="middle"><font color="#FFFFFF">工</font><font color="#FFFFFF"><br>
      <br>
      作<br>
      <br>
      經<br>
      <br>
      歷 </font></td>
      <td height="24" colspan="4"><font color="#FFFFFF">起止時間供職單位
      職務</font></td>
      </tr>
      <tr align="center">
      <td colspan="4" align="left"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="g_shijian1" onFocus="this.select()"
      onMouseOver="this.focus()" size="18"
      >

      <input
      name="g_address1" onFocus="this.select()"
      onMouseOver="this.focus()" size="20"
      >

      <input
      name="g_zhiwu1" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td colspan="4" align="left"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="g_shijian2" onFocus="this.select()"
      onMouseOver="this.focus()" size="18"
      >

      <input
      name="g_address2" onFocus="this.select()"
      onMouseOver="this.focus()" size="20"
      >

      <input
      name="g_zhiwu2" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td colspan="4" align="left"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="g_shijian3" onFocus="this.select()"
      onMouseOver="this.focus()" size="18"
      >

      <input
      name="g_address3" onFocus="this.select()"
      onMouseOver="this.focus()" size="20"
      >

      <input
      name="g_zhiwu3" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td colspan="4" align="left"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="g_shijian4" onFocus="this.select()"
      onMouseOver="this.focus()" size="18"
      >

      <input
      name="g_address4" onFocus="this.select()"
      onMouseOver="this.focus()" size="20"
      >

      <input
      name="g_zhiwu4" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td colspan="4" align="left"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="g_shijian5" onFocus="this.select()"
      onMouseOver="this.focus()" size="18"
      >

      <input
      name="g_address5" onFocus="this.select()"
      onMouseOver="this.focus()" size="20"
      >

      <input
      name="g_zhiwu5" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr>
      <td height="190" rowspan="6" align="center" valign="middle"><font color="#FFFFFF">家<br>

      庭<br>

      成<br>

      員<br>

      及<br>

      主<br>

      要<br>

      社<br>

      會<br>

      關<br>

      系 </font></td>
      <td height="23" colspan="4"><font color="#FFFFFF">姓名 與本人關系
      工作單位 職務</font></td>
      </tr>
      <tr align="center">
      <td width="17%" height="20" align="center" valign="middle"><font color="#FFFFFF"><span id=fps7>
      <input
      name="h_name1" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      <td width="19%" align="center" valign="middle"><font color="#FFFFFF"><span id=fps7>
      <input
      name="h_guanxi1" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      <td width="41%" align="center" valign="middle"><font color="#FFFFFF"><span id=fps7>
      <input
      name="h_danwei1" onFocus="this.select()"
      onMouseOver="this.focus()" size="28"
      >
      </span></font></td>
      <td width="18%" align="center"><font color="#FFFFFF"><span id=fps7>
      <input
      name="h_zhiwu1" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td height="20" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_name2" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      <td width="19%" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_guanxi2" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      <td width="41%" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_danwei2" onFocus="this.select()"
      onMouseOver="this.focus()" size="28"
      >
      </span></font></td>
      <td width="18%" align="center"><font color="#FFFFFF"><span id=fps7>
      <input
      name="h_zhiwu2" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td height="20" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_name3" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      <td width="19%" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_guanxi3" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      <td width="41%" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_danwei3" onFocus="this.select()"
      onMouseOver="this.focus()" size="28"
      >
      </span></font></td>
      <td width="18%" align="center"><font color="#FFFFFF"><span id=fps7>
      <input
      name="h_zhiwu3" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td height="20" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_name4" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      <td width="19%" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_guanxi4" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      <td width="41%" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_danwei4" onFocus="this.select()"
      onMouseOver="this.focus()" size="28"
      >
      </span></font></td>
      <td width="18%" align="center"><font color="#FFFFFF"><span id=fps7>
      <input
      name="h_zhiwu4" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr align="center">
      <td height="20" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_name5" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      <td width="19%" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_guanxi5" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      <td width="41%" align="center" valign="middle"><font color="#FFFFFF"><span
      id=fps7>
      <input
      name="h_danwei5" onFocus="this.select()"
      onMouseOver="this.focus()" size="28"
      >
      </span></font></td>
      <td width="18%" align="center"><font color="#FFFFFF"><span id=fps7>
      <input
      name="h_zhiwu5" onFocus="this.select()"
      onMouseOver="this.focus()" size="10"
      >
      </span></font></td>
      </tr>
      <tr>
      <td align="center"><font color="#FFFFFF">自<br>
      <br>
      我<br>
      <br>
      評<br>
      <br>
      價 </font>
      <td colspan="4" align="center"><textarea name="pingjia" cols="60" rows="5"></textarea>
      <font color="#FFFFFF"><span
      id=fps7><font color="#FF0000">*</font></span></font> <tr>
      <td height="24" colspan="5"><font color="#FFFFFF">對未來工作的設想或其它需要補充的內容
      :</font>
      <tr align="center">
      <td colspan="5"> <textarea name="shexiang" cols="60" rows="5"></textarea>
      <font color="#FFFFFF"><span
      id=fps7><font color="#FF0000">*</font></span></font> <tr>
      <td height="28" colspan="5"><font color="#FFFFFF">備注(工作地點、薪金期望等):
      </font>
      <tr align="center">
      <td colspan="5"><textarea name="beizhu" cols="60" rows="5"></textarea>
      <font color="#FFFFFF"><span
      id=fps7><font color="#FF0000">*</font></span></font> <tr>
      <td colspan="5"><font color="#FFFFFF">&nbsp;</font>
      <tr align="center">
      <td height="23" colspan="5"><font color="#FFFFFF"><span id=fps7>
      <input name="button" type="submit" value="提交">

      <input name="reset" type="reset" value="重新填寫">
      </span></font>
      </table>

      <br>
      <br>

      </form>
      </td>
      </tr>
      </table>

      </body>
      </html>




      日韩精品一区二区三区高清