怎么解决这个代码的问题呀?

hzcctv 2004-09-09 01:26:29
<%
edit_type=Request.Form("action_type") '编辑类型
cid=Request.Form("cid")
allocate_type=Request.Form("allocate_type")
allocate_department=Request.Form("allocate_department")
customer_service=Request.Form("customer_service")
bargain_time=trim(Request.Form("bargain_time"))
contract=trim(Request.Form("contract"))
workload=UpdateStr(trim(Request.Form("workload")))
have_database=Request.Form("have_database")
time_out=Request.Form("time_out")
if have_database="" then have_database="0"
if time_out="" then time_out="0"
have_input_data=Request.Form("have_input_data")
if have_input_data="" then have_input_data="0"
have_flashpage=Request.Form("have_flashpage")
if have_flashpage="" then have_flashpage="0"
time_handover=trim(Request.Form("time_handover"))
validate=trim(Request.Form("validate"))
sales=trim(Request.Form("sales"))
department=trim(Request.Form("department"))
contract_price=trim(Request.Form("contract_price"))
if contract_price="" then contract_price=0
fact_transfer=trim(Request.Form("fact_transfer"))
if fact_transfer="" then fact_transfer=0
item_price=trim(Request.Form("item_price"))
if item_price="" then item_price=0
item_transfer=trim(Request.Form("item_transfer"))
if item_transfer="" then item_transfer=0
remark_kf=UpdateStr(trim(Request.Form("remark_kf")))
remark=UpdateStr(trim(Request.Form("remark")))
%>

<%
if edit_type="add_new" then '当添加新信息时
%>
<!--#include file="../include/check_s29.asp" -->
<%
if allocate_department=3 then '负责人
sqlstr="INSERT INTO t_design(cid,allocate_department_id,allocate_type,employee,bargain_time,contract,workload,time_handover,validate,sales,department,remark_kf,remark) "
sqlstr=sqlstr & "VALUES(" & cid & "," & allocate_department & ",'" & allocate_type & "','" & customer_service & "','" & bargain_time & "','" & contract & "','" & workload
sqlstr=sqlstr & "','" & time_handover & "','" & validate & "','" & sales & "','" & department & "','" & remark_kf & "','" & remark & "')"
else
sqlstr="INSERT INTO t_design(cid,allocate_department_id,allocate_type,bargain_time,contract,workload,have_database,time_out,have_input_data,have_flashpage,time_handover,validate,sales,department,contract_price,fact_transfer,item_price,item_transfer,remark_kf,remark) "
sqlstr=sqlstr & "VALUES(" & cid & "," & allocate_department & ",'" & allocate_type & "','" & bargain_time & "','" & contract & "','" & workload
sqlstr=sqlstr & "','" & have_database & "','" & time_out & "','" & have_input_data & "','" & have_flashpage & "','" & time_handover & "','" & validate & "','" & sales & "','" & department & "'," & contract_price & "," & fact_transfer & "," & item_price & "," & item_transfer & ",'" & remark_kf & "','" & remark & "')"
end if

conn.Execute(sqlstr)

title_str="添 加 新 记 录"
msg_str="<b><font color=red>添加成功!</font></b><br><br>"
msg_str=msg_str & "<a href='enterprise_detail.asp?id=" & cid & "'>浏览信息</a>"
return_to_add

elseif edit_type="edit" then '当修改信息时
%>
<!--#include file="../include/check_s30.asp" -->
<%
id=Request.Form("id") '取得要修改的信息ID号
test_version=Request.Form("test_version")
true_version=Request.Form("true_version")
confirm=Request.Form("confirm")
confirm_time=Request.Form("confirm_time")
confirm_amount_kefu=Request.Form("confirm_amount_kefu")
if confirm_amount_kefu="" then confirm_amount_kefu=0

str1="UPDATE t_design SET "
str1=str1 & "cid=" & cid & ","
str1=str1 & "allocate_department_id=" & allocate_department & ","
str1=str1 & "allocate_type='" & allocate_type & "',"
str1=str1 & "bargain_time='" & bargain_time & "',"
str1=str1 & "contract='" & contract & "',"
str1=str1 & "workload='" & workload & "',"
str1=str1 & "have_database='" & have_database & "',"
str1=str1 & "time_out='" & time_out & "',"
str1=str1 & "have_input_data='" & have_input_data & "',"
str1=str1 & "have_flashpage='" & have_flashpage & "',"
str1=str1 & "time_handover='" & time_handover & "',"
str1=str1 & "validate='" & validate & "',"
str1=str1 & "sales='" & sales & "',"
str1=str1 & "department='" & department & "',"
str1=str1 & "contract_price=" & contract_price & ","
str1=str1 & "fact_transfer=" & fact_transfer & ","
str1=str1 & "item_price=" & item_price & ","
str1=str1 & "item_transfer=" & item_transfer & ","
str1=str1 & "test_version='" & test_version & "',"
str1=str1 & "true_version='" & true_version & "',"

if confirm="1" then
str1=str1 & "confirm=1,"
str1=str1 & "confirm_time='" & confirm_time & "',"
else
str1=str1 & "confirm=0,"
end if

if allocate_department=3 then '负责人
str1=str1 & "employee='" & customer_service & "',"
end if

str1=str1 & "remark_kf='" & remark_kf & "',"
str1=str1 & "remark='" & remark & "',"
str1=str1 & "confirm_amount_kefu=" & confirm_amount_kefu & ""
str1=str1 & " where id=" & id

conn.Execute(str1)

return_to_edit() '返回修改页面

else
title_str="非 法 操 作"
msg_str="<b><font color=red>你执行了非法操作!</font></b><A href='javascript:history.back(-1)'>请返回.</A>"
return_to_add
end if
%>

<%sub return_to_edit()%>
<form action="design_edit01.asp" method=post name="frm_design">
<input type="hidden" name="action_type" value="<%=edit_type%>">
<input type="hidden" name="me_page" value=<%=session("current_edit_page")+1%>>
<INPUT type="hidden" name="cid" value="<%=cid%>">
<INPUT type="hidden" name="ep_id" value="<%=id%>">
<INPUT type="hidden" name="success_mes" value="Successfully">
</form>
<script language="javascript">
document.frm_design.submit();
</script>
<%end sub%>


<%sub return_to_list()%>
<form action="list_news.asp" method=post name="frm_page">
<input type="hidden" name="me_page" value=<%=session("back_page")%>>
<input type="hidden" name="keyword" value=<%=session("back_keyword")%>>
<input type="hidden" name="news_type" value=<%=session("back_sort")%>>
<input type="hidden" name="range" value=<%=session("back_range")%>>
</form>
<script language="javascript">
document.frm_page.submit();
</script>
<%end sub%>

<%sub return_to_add()%>
<!--#include file="../include/header.asp" -->
<table width="700" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="10"></td>
</tr>
<tr align="middle" >
<td height="20">
<table width="630" border="1" cellspacing="0" cellpadding="0" class=smallfonts bordercolorlight="#000000" bordercolordark="#ffffff">
<tr align="left" bgcolor="#3366cc">
<td height="28" >  <font face=webdings color="#ffffff">8</font><A href="main.asp"><font color="#ffffff">回主菜单</font></A>
<img src="/pixel.gif" width="200" height="1"><span style="FONT-SIZE: 14px"><b><font color="#ffffff"><%=title_str%></font></b></span></td>
</tr>
<tr align="center">
<td height="120"><%=msg_str%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="10"></td>
</tr>
</table>
<!--#include file="../include/bottom.asp" -->
<%end sub%>




提示以下错误:


Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]列名 'time_out' 无效。

/manage/design_ok01.asp,行112



怎么改?
...全文
56 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
孟子E章 2004-09-09
  • 打赏
  • 举报
回复
str1=str1 & "time_out='" & time_out & "',"

行删除
hzcctv 2004-09-09
  • 打赏
  • 举报
回复
那如果我不要这个'time_out'字段的时候,我应该删除哪一些代码?不让这个页面出错呢
zltostem 2004-09-09
  • 打赏
  • 举报
回复
列'time_out' 不存在
lbd8848 2004-09-09
  • 打赏
  • 举报
回复
列名 'time_out' 无效。
bananasmiling 2004-09-09
  • 打赏
  • 举报
回复
说明在t_design这张表中没有str1=str1 & "time_out='" & time_out & "',"这个字段值。。请检查。。。
wangwm 2004-09-09
  • 打赏
  • 举报
回复
你的表t_design里面没有'time_out' 这个字段或者字段名字有问题
  • 打赏
  • 举报
回复
Active Server Pages, ASP 0126 (0x80004005) --> 找不到包含文件

Microsoft OLE DB Provider for ODBC Drivers (0x80040E21) --> sql语句出错(数据类型不匹配或表名(字段名)错误或表处于编辑状态,或表不存在于conn打开的数据库中)
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) --> sql语句出错(字段名错误,或数据类型不匹配)
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07) --> sql语句出错(要插入或更新的字段的类型与变量数据类型不匹配)
Microsoft OLE DB Provider for ODBC Drivers (0x80040E57) --> sql语句出错(要插入或更新的数据溢出)
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10) --> sql语句出错(update字段名或要更新的数据类型错误)
Microsoft OLE DB Provider for ODBC Drivers (0x80004005) --> sql语句出错(要插入或更新的字段的数值不能为空值)
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)  --> 打开数据库出错,没有在指定目录发现数据库
Microsoft OLE DB Provider for ODBC Drivers (0x80040E37) --> 没有发现表

Microsoft VBScript 运行时错误 (0x800A000D) --> 错误引用rs变量(rs对像已关闭或未定义)
Microsoft VBScript 运行时错误 (0x800A01C2) --> vbscript脚本错误(vbscript语句出错)
Microsoft VBScript 运行时错误 (0x800A0006) --> vbscript脚本错误(溢出错误)
Microsoft VBScript 编译器错误 (0x800A040E) --> 缺少loop
Microsoft VBScript 编译器错误 (0x800A03EA) --> 缺少if或end if
Microsoft VBScript 编译器错误 (0x800A03EE) --> 语句未结束(缺少")")
Microsoft VBScript 编译器错误 (0x800A03F6) --> if语句出错(缺少end if)
Microsoft VBScript 运行时错误 (0x800A005B) --> 缺少set
Microsoft VBScript 运行时错误 (0x800A0005) --> 变量未定义
Microsoft VBScript 编译器错误 (0x800A03F9) --> if语句缺少then
Microsoft VBScript 编译器错误 (0x800A0411) --> dim语句定义错误
Microsoft VBScript 编译器错误 (0x800A0408) --> sql语句错误(?????????????????)


ADODB.Recordset (0x800A0BB9) --> sql语句出错(sql语句或conn语句未定义或对一个rs属性进行赋值时发生错误)
ADODB.Recordset (0x800A0CC1) --> rs对像出错(rs对像本身不存在或错误地引用了一个不存在的字段名)
ADODB.Recordset (0x800A0BCD) --> rs对像出错(记录集中没有记录却对记录集进行操作)
ADODB.Recordset (0x800A0E78) --> rs对像出错(记录集不存在,缺少rs.open语句)
ADODB.Recordset (0x800A0CC1) --> rs对像出错(引用了一个不存在的字段名)
ADODB.Recordset (0x800A0E7D) --> conn定义错误
ADODB.Recordset (0x800A0CB3) --> 数据库以只读方式打开,无法更新数据。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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