| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 467 人关注过本帖
标题:为何不能读入数据库
只看楼主 加入收藏
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
 问题点数:0 回复次数:2 
为何不能读入数据库
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="conn.asp"--> <% function changechr(str) str=server.htmlencode(str) str=replace(str,chr(39),"") str=replace(str,vbcrlf,"<br>") str=replace(str,chr(13),"<br>") changechr=str end function oq=request(oq) if oq<>"" then select case "oq" case "add" diary_title=request(diary_title) diary_weather=request(diary_weather) diary_secret=request(diary_secret) diary_mood=Mood&request(diary_mood)&.gif diary_content=request(diary_content) dddd = year(now()) & "-" & month(now()) & "-" & day(now()) '在数据库中增加一条文章记录 set rs=server.createobject("adodb.recordset") sql="select * from zhan_diary where (diary_id is null)" rs.open sql,conn,1,3 rs.addnew rs("diary_time")=dddd rs("diary_title")=diary_title rs("diary_weather")=diary_weather rs("diary_secret")=diary_secret rs("diary_mood")=diary_mood rs("diary_content")=diary_content rs.update response.write "是否继续添加<a href='diaryedit.asp?op=add'>是</a><a href='diary.asp'>否</a>" case "change" end select end if %> 帮我看下有没有错
搜索更多相关主题的帖子: 数据库 
2005-09-22 21:01
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 

<form action="diarysave.asp?oq=add" method="post"></form> <form action="diarysave.asp?oq=change" method="post"><form> diarysave.asp: <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="conn.asp"--> <% function changechr(str) str=server.htmlencode(str) str=replace(str,chr(39),"") str=replace(str,vbcrlf,"<br>") str=replace(str,chr(13),"<br>") changechr=str end function oq=request(oq) if oq<>"" then select case oq case "add" diary_title=request(diary_title) diary_weather=request(diary_weather) diary_secret=request(diary_secret) diary_mood=request(diary_mood) diary_content=request(diary_content) dddd = year(now()) & "-" & month(now()) & "-" & day(now()) set rs=server.createobject("adodb.recordset") sql="select * from zhan_diary where (diary_id is null)" rs.open sql,conn,1,3 rs.addnew rs("diary_time")=dddd rs("diary_title")=diary_title rs("diary_weather")=diary_weather rs("diary_secret")=diary_secret rs("diary_mood")=diary_mood rs("diary_content")=diary_content rs.update response.write "是否继续添加<a href='diaryedit.asp?op=add'>是</a><a href='diary.asp'>否</a>" case "change" diary_id=request(diary_id) diary_title=request(diary_title) diary_weather=request(diary_weather) diary_content=request(diary_content) sql="update set diary_title='"&diary_title&"',diary_weather='"&diary_weather&"',diary_content='"&diary_content&"' where diary_id="&diary_id conn.execute(sql) end select end if %>

这样有错吗,不知道为何更新不入数据库

[此贴子已经被作者于2005-9-22 21:27:17编辑过]


中国人的财富网:http://www..cn/
2005-09-22 21:25
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 
问题已经解决不用回了.

中国人的财富网:http://www..cn/
2005-09-22 22:56
快速回复:为何不能读入数据库
数据加载中...
 
   



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

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