| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 612 人关注过本帖
标题:[求助]数据库写入问题
只看楼主 加入收藏
smyh
Rank: 2
等 级:论坛游民
帖 子:97
专家分:25
注 册:2007-1-1
结帖率:80%
收藏
 问题点数:0 回复次数:5 
[求助]数据库写入问题

数据库表

图片附件: 游客没有浏览图片的权限,请 登录注册


程序:为什么每次增加内容的时候,需要把标题和内容都添上数值才写入数据库,要不就写入不了
<%
if request("no")="add" then
en=trim(request.Form("en"))
title=trim(request.Form("title"))
content=trim(request.Form("content"))
set rs=server.createobject("adodb.recordset")
sql="select * from gg "
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("content")=content
rs("en")=en
rs.update
rs.close
set rs=nothing
response.write "<script language='javascript'>" & chr(13)
response.write "alert('修改成功!');" & Chr(13)
response.write "window.document.location.href='ggs.asp';"&Chr(13)
response.write "</script>" & Chr(13)
Response.End
end if%>

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top">
<table width="90%" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
<form name="myform" method="post" action="?no=add" >
<tr align="center">
<td class="back_southidc" height="30" colspan="2">公告增加</td>
</tr>


<tr bgcolor="#ECF5FF">
<td height="24" align="right">中英文选择</td>
<td valign="top"><label>
<select name="en">
<option value="1">中文</option>
<option value="2">英文</option>
</select>
</label></td>
</tr>
<tr bgcolor="#ECF5FF">
<td height="24" align="right">标题:</td>
<td valign="top"><input type="text" name="title"></td>
</tr>
<tr bgcolor="#ECF5FF">
<td width="22%" height="24" align="right">内容</td>
<td width="78%" valign="top">  
<textarea name="content" style="display:none"></textarea>
<iframe id="eWebEditor1" src="editor/ewebeditor.asp?id=content&style=s_3d" frameborder="0" scrolling="no" width="98%" height="350"></iframe></td>
</tr>



<tr align="center" bgcolor="#ECF5FF">
<td height="35" colspan="2">
<input type="submit" name="Submit" value="提交" class="input">
 
<input type="reset" name="Submit2" value="重置" class="input"> </td>
</tr>
</form>
</table>
</td>
</tr>
</table>

[此贴子已经被作者于2007-3-25 18:55:46编辑过]

搜索更多相关主题的帖子: 数据库 content title request 
2007-03-25 18:53
ttj99
Rank: 1
等 级:新手上路
帖 子:82
专家分:0
注 册:2005-6-30
收藏
得分:0 
数据属性的设置问题
2007-03-25 21:08
smyh
Rank: 2
等 级:论坛游民
帖 子:97
专家分:25
注 册:2007-1-1
收藏
得分:0 

是数据库属性问题吗?

2007-03-26 08:16
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
收藏
得分:0 
可能是你的数据库中标题和内容两个字段设置不可空了!

专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2007-03-26 08:20
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
收藏
得分:0 
同意楼上的

http://www./
2007-03-26 09:16
smyh
Rank: 2
等 级:论坛游民
帖 子:97
专家分:25
注 册:2007-1-1
收藏
得分:0 

非常感谢,已经解决了哦。呵呵

2007-03-27 08:30
快速回复:[求助]数据库写入问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013949 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved