!--#include file="conn.asp" --> % whattitle=request.form("title") whoauthor=request.form("author") whatcontent=request.form("content") %> % Set rs = Server.CreateObject ("ADODB.Recordset") sql = "Select * from cnarticle" rs.Open sql,conn,3,2 %> % rs.addnew rs("cn_title")=whattitle rs("cn_author")=whoauthor rs("cn_content")=whatcontent rs.update %> 文章添加成功,a href="showit.asp">瀏覽/a> % rs.close Set rs = Nothing conn.close set conn=Nothing %> |
!--#include file="conn.asp" --> % whattitle=trim(request.form("title")) whoauthor=trim(request.form("author")) whatcontent=trim(request.form("content")) %> %if whattitle="" then%> script language=vbs> alert("請(qǐng)輸入文章標(biāo)題") history.go(-1) /script> %end if%> %if whatcontent="" then%> script language=vbs> alert("請(qǐng)輸入文章標(biāo)題") history.go(-1) /script> %end if%> % Set rs = Server.CreateObject ("ADODB.Recordset") sql = "Select * from cnarticle" rs.Open sql,conn,3,2 %> % rs.addnew rs("cn_title")=whattitle rs("cn_author")=whoauthor rs("cn_content")=whatcontent rs.update %> 文章添加成功,a href="showit.asp">瀏覽/a> % rs.close Set rs = Nothing conn.close set conn=Nothing %> |
%if whattitle="" then%> script language=vbs> alert("請(qǐng)輸入文章標(biāo)題") history.go(-1) /script> %end if%> |
rs.addnew rs("cn_title")=whattitle ... rs.update |
!--#include file="conn.asp" --> % whattitle=request.form("title") whoauthor=request.form("author") whatcontent=request.form("content") %> % sql = "insert into cnarticle(cn_title,cn_author,cn_content) values(' "whattitle" ',' "whoauthor" ',' "whatcontent" ')" conn.Execute(sql) %> 文章添加成功,a href="showit.asp">瀏覽/a> % conn.close set conn=Nothing %> |
Microsoft JET Database Engine 錯(cuò)誤 '80040e21' 字段 'xxx.xxx' 不能是零長(zhǎng)度的字符串。 |
標(biāo)簽:朝陽(yáng) 馬鞍山 遼陽(yáng) 平頂山 四平 湖北 孝感 防城港
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ASP編程入門(mén)進(jìn)階(二十):ADO組件之插入數(shù)據(jù)記錄》,本文關(guān)鍵詞 ASP,編程,入門(mén),進(jìn)階,二十,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。