| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1114 人关注过本帖
标题:[求助]為什麼我用ASP頁面刪除數據信息出現錯誤
只看楼主 加入收藏
unix
Rank: 1
等 级:新手上路
帖 子:134
专家分:0
注 册:2005-12-28
收藏
得分:0 
以下是引用阳光白雪在2005-12-31 16:38:00的发言:
换成你的 db

改成db後
出現
錯誤類型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: '=' 附近有語法錯誤。
/roylong/admin/xh_del.asp, 第 4 行

2005-12-31 16:45
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
收藏
得分:0 
db.Execute "DELETE FROM 營業 where lianluo='"& lianluo &"'",,adCmdText + adExecuteNoRecords


别急,再来!!

专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2005-12-31 16:47
unix
Rank: 1
等 级:新手上路
帖 子:134
专家分:0
注 册:2005-12-28
收藏
得分:0 

把兩個文件改成這樣,不報錯,刪除數據信息也沒有反應,沒有刪除成功。
<!--#include file="xh_conn.asp"-->
<%
lianluo=request.querystring("lianluo")
delsql="delete from 營業 where lianluo='"&lianluo&"'"
db.execute(delsql)
response.redirect "xh_add.asp"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>無標題文檔</title>
</head>

<body>
</body>
</html>

xh_conn.asp文件代碼
<%
set db=server.createobject("adodb.connection")
db.open "Driver={SQL Server};server=cylong;database=生產管理;uid=sa;pwd="
%>

[此贴子已经被作者于2005-12-31 17:14:47编辑过]

2005-12-31 17:14
rainic
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2367
专家分:0
注 册:2005-8-9
收藏
得分:0 
lianluo等于什么?你输出来看看

2005-12-31 17:24
unix
Rank: 1
等 级:新手上路
帖 子:134
专家分:0
注 册:2005-12-28
收藏
得分:0 
lianluo是一个号码
根据lianluo来确定删除那组数据
2005-12-31 17:28
unix
Rank: 1
等 级:新手上路
帖 子:134
专家分:0
注 册:2005-12-28
收藏
得分:0 

下面的代碼是前一頁的
<!--#include file="xh_conn.asp"-->

<%
sql="select * from 營業"
set rs=db.execute(sql)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理頁面</title>
<style type="text/css">
<!--
table {
font-size: 9pt;
text-decoration: none;
border: 1px solid #000000;
}
-->
</style>
<style type="text/css">
<!--
a {
font-size: 9pt;
color: #000000;
text-decoration: none;
}
-->
</style>
</head>

<body>
<p align="center"><font color="#FFFFFF"><a href="xh_write.asp">添加錄入</a> </font><a href="xh_loginout.asp">退出管理</a></p>
<table width="666" border="0" align="center" cellpadding="5" cellspacing="0">
<tr align="center" bgcolor="#006699">
<td colspan="5"><font color="#FFFFFF">錄入 管 理 頁 面</font></td>
</tr>
<tr align="center">
<td width="271"> ?j ?/td>
<td width="120"><font color="#FF0000">型號</font></td>
<td width="161"><font color="#FF0000">編輯</font></td>
<td colspan="2"><font color="#FF0000"> 刪除</font></td>
</tr>
<%do while not rs.eof%>
<tr>
<td align="center"><%=rs("lianluo")%></td>
<td><a href=../xh_look.asp?id=<%=rs("lianluo")%> target="_blank"><%=rs("型 ?)%></a></td>
<td align="center"><a href="xh_edit.asp?id=<%=rs("lianluo")%>">編輯</a></td>
<td width="72" align="center"><a href="xh_del.asp?id=<%=rs("lianluo")%>">刪除</a></td>
</tr>
<%
rs.movenext
loop
%>
</table>
<br>
</body>
</html>

2005-12-31 17:30
rainic
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2367
专家分:0
注 册:2005-8-9
收藏
得分:0 
<td width="72" align="center"><a href="xh_del.asp?id=<%=rs("lianluo")%>">刪除</a></td>
改成:lianluo

2005-12-31 17:34
unix
Rank: 1
等 级:新手上路
帖 子:134
专家分:0
注 册:2005-12-28
收藏
得分:0 
以下是引用rainic在2005-12-31 17:34:00的发言:
<td width="72" align="center"><a href="xh_del.asp?id=<%=rs("lianluo")%>">刪除</a></td>
改成:lianluo

謝謝,可以了。

2005-12-31 17:38
快速回复:[求助]為什麼我用ASP頁面刪除數據信息出現錯誤
数据加载中...
 
   



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

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