• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >vc/mfc > 高手们我都不行了,实在条不出来了,请指点!!!

高手们我都不行了,实在条不出来了,请指点!!!

作者:佚名 字体:[增加 减小] 来源:互联网 时间:2017-06-04

佚名通过本文主要向大家介绍了 高手们我都不行了,实在条不出来了,请指点!!!等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 高手们我都不行了,实在条不出来了,请指点!!!
描述:

我做的产品类型添加,编辑和删除都出错了,急呀!!!
   删除时的错误:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] 无法从指定的数据表中删除。
/products/admin/category.asp, 第 27 行
   添加时的错误:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] 操作必须使用一个可更新的查询。
/products/admin/category.asp, 第 68 行
   编辑时的错误:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] 操作必须使用一个可更新的查询。
/products/admin/category.asp, 第 100 行
我的删除,添加和编辑都在CATEGORY.ASP里,代码如下:
<%@ Language=VBScript %>
<% option explicit %>
<!--#include file="conn.asp"-->
<!--#include file="../style.asp"-->
<!--#include file="chkadmin.asp"-->
<% 
dim curaction, curid,curpage, bedit, founderr, errmsg
if request("page")="" then
   curpage = 1
else
curpage = cint(request("page"))
end if
curaction = request("action")
curid = request("id")
bedit = false
founderr = false
if curaction = "edit" then
bedit = true
end if
dim sql
'删除记录
if curaction = "delete" then
sql = "DELETE FROM category WHERE id=" + cstr(curid)
conn.execute sql        '第27行
sql = "delete from news where cateid=" + cstr(curid)
conn.execute sql
if err.number <> 0 then
response.write "数据库操作错误:" + err.description
err.clear
else
response.write "记录已经删除。"
end if
%>
<script>
top.menu.location.reload()
</script>
<%
end if
'添加记录
if curaction = "newsave" then
if trim(request("txttitle")) = "" then
founderr = true
errmsg = "<p>请输入产品类别!</p>"
end if
if trim(request("en_txttitle")) = "" then
founderr = true
errmsg = "<p>请输入产品类别英文名称!</p>"
end if
sql="select * from category where title='" & request("txttitle") & "'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.recordcount > 0 then 
   founderr=true
   errmsg = errmsg & "<p>该类别已经存在!</p>"
end if
rs.close
if founderr then
response.write errmsg
else
    sql = "insert into category(title,en_title,class_id) values('"
sql = sql + cstr(request("txttitle")) + "','" + cstr(request("en_txttitle")) + "','" + request("class") + "')"
'response.write sql
'response.end
conn.execute sql           '第68行
if err.number <> 0 then
response.write "无法保存,数据库操作出错:" + err.description
else
response.write "记录已经添加到数据库。"
end if
end if
%>
<script>
 top.menu.location.reload()
</script>
<%
end if
'保存记录
if curaction = "editsave" then
if trim(request("txttitle")) = "" then
founderr = true
errmsg = "<p>请输入产品类别!</p>"
end if
if trim(request("en_txttitle")) = "" then
founderr = true
errmsg = "<p>请输入产品类别英文名称!</p>"
end if
if founderr then
response.write errmsg
else
sql = "UPDATE category SET "
sql = sql + "title='" + htmlencode(request("txttitle")) + "',"
sql = sql + "en_title='" + htmlencode(request("en_txttitle")) + "',"
sql = sql + " class_id = " + request("class")
sql = sql + " WHERE id = " + cstr(curid)
conn.execute sql        '第100行
if err.number <> 0 then
response.write "无法保存,数据库操作出错:" + err.description
else
response.write "记录已经更新到数据库。"
end if
end if
end if
 %>
'下面的是接着的


解决方案1:

http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=1007
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=1558
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=116346
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=152202
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=179774
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=91037
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=178214


分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 高手们我都不行了,实在条不出来了,请指点!!!

相关文章

  • 2017-06-05 怎样在动态库里得到调用它的程序的名称?
  • 2017-06-04 有关COM编程,什么时候要考虑"线程模型"?
  • 2017-06-04 activexcontrol中使用CWebBrowser控件的问题?(之前那个帖子分数忘记选了)
  • 2017-06-04 我想自己写个简单的Web服务器,在非windows的环境下运行,可以支持包含Activex控件的网页吗?
  • 2017-06-05 在线等待中问题,一定给分:CreateProcess的参数STARTUPINFO结构中,HANDLEhStdInput在什么时候用?
  • 2017-06-04 关于ATL控件字符串参数长度的问题
  • 2017-06-05 关于PDF文件加密的问题?
  • 2017-06-05 怎么样用vc调用vb并传递参数
  • 2017-06-04 高分求教:我得到了接口指针,但运行到调用该接口的函数时总是异常退出。
  • 2017-06-04 在ATL中如何实现从程序->资源管理器的拖放。重分酬谢

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • 大量vc资料下载http://wwwdsendcom同志们,好别忘了顶。
    • 在网页中注册OCX控件后,在html代码中的不同位置调用控件的接口方法,是否有影响?
    • 怎么设置自己开发的ActiveX控件在设计时候的大小和样式?
    • 怎样停止IE中flash的声音播放?
    • NT40中关于com对象不可创建的问题
    • 请教各位大哥:在一对多通信中,我有多线程来处理多个连接,请问用什么同步方法比较好,采样为22k
    • COleDataSource::DoDragDrop符号无法解析问题(紧急求助)
    • VC打印机中映射方式的区别
    • CoMarshalInterThreadInterfaceInStream传递一个特殊的IDispatch
    • 重写了IPersistStorage的Load、save函数,但是没能正确保存图像数据

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有