ASP的问题 急急急

来源:百度知道 编辑:UC知道 时间:2024/06/22 20:40:31
<html>
<head></head>
<!--#include file="Conn.asp"-->
<Link href="Css.css" rel=stylesheet>
<body>
<center>
<%
Dim stids, datas, coid, mark, note, i
stids = Split(Request("stids"), ";")
datas = Split(Request("datas"), ";")
coid = Request("coid")
i = 0
For Each stid In stids
mark = Left(datas(i),3)
note = mid(datas(i),4)
mysql = "INSERT INTO Sreport (stid, coid , mark, note)" & _
"VALUES " & _
"('" & stid & "','" & coid & "'," & mark & ",'" & note & "')"
Conn.Execute mysql
i = i + 1
Next
Response.Write("本次操作成功添加了【" & i & "】条成绩记录!")
Conn.Close
Set Conn = nothing

response.write(sql);输出sql语句放到sql server中运行就知道了

stid, coid , mark, note
请确定MARK字段是数值型
其他是字符型.

coid = Request("coid")
mark = Left(datas(i),3)
note = mid(datas(i),4)
之中有没NULL值.

调试方法
在此句
Conn.Execute mysql
前加一句
response.write mysql
response.end
然后执行.
看写出的SQL INSTERT INTO语句是否正确
如果看不出
则COPY 到ACCESS执行一下试试.