为什么以前可以通过网页 update 的表,当我改变了表机构后,就不可以修改了?但是没有任何的报错???

pcuncle 2003-06-25 11:32:11
为什么以前可以通过网页 update 的表,当我改变了表机构后,就不可以修改了?但是没有任何的报错???
请问谁有这样的经历?怎么解决?谢谢
...全文
62 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
pcuncle 2003-06-26
  • 打赏
  • 举报
回复
Update

这句话是关键
sql="update e_dp_mstr set e_dp_dsc= "&AID(j)&" where e_dp_id='"&AName(j)&"' "
adminrs.Open sql , con
next


CrazyFor 2003-06-26
  • 打赏
  • 举报
回复
能不能说说具体是做什么样的操作,
pcuncle 2003-06-26
  • 打赏
  • 举报
回复
下面是代码:请高手,指点,谢谢
<!-- #INCLUDE FILE="header.asp" -->

<right><tr><b><font face="Tahoma" size="2" color="#950000">Welcome <%=Request.Cookies("FullName")%></font></b></tr></right></p>


<%

dim action
action=Trim(Request.QueryString("action"))
if action="" then
action="display"
end if

cm_type = Request.Form("cm_type")
'cm_sort = Request.Form("cm_sort")
cm_sort = right(cm_type, 15)

cm_type = left(cm_type, 7)
modifier = Request.Cookies("FullName")

Select Case action
case "display" call display
Case "indexone" Call indexone
End Select
cm_type = Request.Form("cm_type")
sub display
cm_type = Request.Form("cm_type")
'cm_sort = Request.Form("cm_sort")
cm_sort = right(cm_type, 105)
cm_type = left(cm_type, 7)
Response.Write "<B>Customer:</b> "
Response.Write cm_sort
'Response.Write modifier
'Response.Write cm_type
Response.Write "<input type=""hidden"" name=""cm_type"" size=""15"" maxlength=""15"" value="&cm_type&"></TD></P>"
Response.Write "<TABLE BORDER=1>"
%>
<form name="indexone" method="post" action="getdata.asp?action=indexone">

<TD WIDTH=50><B>Customer_code</B></TD>
<TD WIDTH=50><B>Description </B></TD>
<TD WIDTH=50><B>Discount </B></TD>
<TD WIDTH=50><B>Quantity_From</B></TD>
<TD WIDTH=10><B>Quantity_To</B></TD>

<%
Set con = Server.CreateObject("ADODB.Connection")
con.Open "DSN=CHNSales;UID=SQLUser;PWD=XXXXXX;"
Set adminrs = Server.CreateObject("ADODB.Recordset")
sql="Select * From chndevelop..e_dp_mstr where e_dp_cmtype = '" & cm_type &"' "
adminrs.Open sql , con
set e_dp_cmtype = adminrs ("e_dp_cmtype")
set cm_sort = adminrs ("cm_sort")
set e_dp_ds = adminrs ("e_dp_ds")
set e_dp_dsc = adminrs ("e_dp_dsc")
set e_dp_qty_from = adminrs ("e_dp_qty_from")
set e_dp_qty_to = adminrs ("e_dp_qty_to")
set e_dp_eff_date = adminrs ("e_dp_eff_date")
set e_dp_id = adminrs ("e_dp_id")
Response.Write "</TR>"
While Not adminrs.EOF
%>

<%
Response.Write "<TD>" &e_dp_cmtype& ""
%>
<td><%=adminrs("e_dp_ds")%><input type="hidden" name="e_dp_ds" size="15" maxlength="15" value="<%=adminrs("e_dp_ds")%>"></td></P>
<td><input type="text" name="e_dp_dsc" size="4" maxlength="4" value="<%=adminrs("e_dp_dsc")%>"></td></P>
<%
Response.Write "<TD>" &e_dp_qty_from& " </TD></P>"
Response.Write "<TD>" &e_dp_qty_to& " </TD></P></tr>"
'Response.Write "<TD>" &e_dp_id& " </TD></P>"
%>
<%
adminrs.MoveNext
wend
'End If
%>
<input type="submit" value="Update"></td>
</table>
</form>
</td>
<br>
<%
adminrs.close
End Sub
%><%
Sub indexone
dim AID,AName,sql, cm_type
Response.Write cm_type
AID=split(request("e_dp_dsc"),", ")
AName=split(request("e_dp_id"),", ")
for j=0 to ubound(AName)
Set con = Server.CreateObject("ADODB.Connection")
con.Open "DSN=CHNSales;UID=SQLUser;PWD=greatwall01;"
Set adminrs = Server.CreateObject("ADODB.Recordset")
sql="update e_dp_mstr set e_dp_dsc= "&AID(j)&" where e_dp_id='"&AName(j)&"' "
adminrs.Open sql , con
next
response.write "<br><br><p>Success</p><br>"
cm_type = Request.Form("cm_type")
response.write cm_type
%>
<meta http-equiv="refresh" content="2;URL=main.asp">
<%
'<meta http-equiv="refresh" content="2;URL=getdata.asp?action=display">
End Sub
%><!-- #INCLUDE FILE="footer.asp" -->
TedZhou 2003-06-25
  • 打赏
  • 举报
回复
没有报错可能是程序屏蔽了错误。
你要说清楚具体现象别人才可能帮你
CrazyFor 2003-06-25
  • 打赏
  • 举报
回复
修改表结构后肯定是还可以修改的,
CrazyFor 2003-06-25
  • 打赏
  • 举报
回复
检查你的UPDATE语句的问题.

22,210

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧