我有一個(gè)數(shù)據(jù)庫(kù)里面的表名為news。字段名分別為ID(自動(dòng)排序),title(新聞標(biāo)題),content(新聞內(nèi)容)我的連接數(shù)據(jù)庫(kù)的文件是conn.asp我寫了代碼:<form name="form1" method="post" action="edit.asp"> <table width="59%" height="193" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr align="center"> <td height="22" colspan="2" bgcolor="#6699FF">修改新聞 ‖<a href="zhijianlist.asp">返回</a>‖</td> </tr> <tr bgcolor="#FFFFFF"> <td height="26" align="right" valign="bottom" bgcolor="#FFFFFF"><div align="right">新聞主題: </div></td> <td align="right" valign="bottom" bgcolor="#FFFFFF"><div align="left"> <input name="title" type="text" id="title" size="30" /> </div></td> </tr> <tr bgcolor="#FFFFFF"> <td width="25%" align="right">新聞內(nèi)容:</td> <td width="75%" align="left"><textarea name="content" cols="50" rows="6" id="content"></textarea></td> </tr> <tr align="center" bgcolor="#FFFFFF"> <td colspan="2"><input type="submit" name="Submit" value="提交" />   <input type="reset" name="Submit2" value="重置" /> <input type="hidden" name="sub" value="sub" /></td> </tr> </table></form>這是供提交修改新聞的表單。然后在下邊寫<%.....%>里邊的這段程序代碼該怎么寫啊。我想通過響應(yīng)上一頁(yè)面的新聞列表里用戶指定的ID,向數(shù)據(jù)庫(kù)相應(yīng)的ID條目里修改數(shù)據(jù)title和content兩項(xiàng)的內(nèi)容。請(qǐng)問這該怎么寫啊謝謝高手指點(diǎn)阿

熱心網(wǎng)友

首先要打開數(shù)據(jù)庫(kù):在form里加 " /然后提交處理:newsid=request.QueryString("id")set rs=server.CreateObject("adodb.recordset")rs.open "select * from news where newsid="&newsid,conn,1,3rs("title")=trim(request.form("title"))rs("content")=trim(request.form("content"))rs.updaters.closeset rs=nothing