请各位帮我看看哦的问题

cz494 2003-09-28 12:00:34
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

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

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

[Microsoft][ODBC Microsoft Access Driver] INSERT INTO 语句的语法错误。

/lao1/cjcxinput.asp,行36


源码如下

<!--#include file="dbconn.asp"-->
<!--#include file="sqlstr.asp"-->
<%
Set rec = Server.CreateObject("ADODB.RecordSet")
actions = Request("actions")
loginMsg = "(请先登陆)"
msgInfo = ""
if actions = "alogin" then
username = Request("username")
password = Request("password")
sql = "select * from studentinfo where usertype='A' and CollegeNo='" & username & "'"
if iExistRecord(sql) then
rec.open sql,conn,1,3
if rec("password") = password then
session("cjcxinput") = true
end if
rec.close
end if
if session("cjcxinput") <> true then
logError = "[登陆错误!请重新登陆]"
end if
end if
if session("cjcxinput")= true then loginMsg = "(您已成功登陆)"
if actions = "ainput" and session("cjcxinput")=true then
iID = sqlstr(Request("icID"))
iDT = sqlstr(Request("icDT"))
iZY = sqlstr(Request("icZY"))
iYear = sqlstr(Request("icYear"))
iName = sqlstr(Request("icName"))
iCollege = sqlstr(Request("icCollege"))
'sql0 = "s"
sql1 = "select * from studentinfo where usertype='S' and CollegeNo=" & iID & ""
sql2 = "select * from success where collegeno =" & iID & " and termyear=" & iYear
if Not iExistRecord(sql1) then
ssql = "insert into studentinfo (CollegeNo,PassWord,regDT,zhuanye,name) values("&iID&",'123456',"&iDT&","&icZY&","&iName&")"
conn.execute ssql
msgInfo = "<li>学号" & iID & "已经存入数据库,初始密码123456"
end if
if Not iExistRecord(sql2) then
ssql = "insert into success(CollegeNo,termYear,success) values("&iID&","&iYear&"," &iCollege& ")"
conn.execute ssql
msgInfo = msgInfo & "<li>学号" & iID & "成绩已经存入数据库"
else
ssql = "update success set success=" & iCollege & " where collegeno =" & iID & " and termyear=" & iYear
conn.execute ssql
msgInfo = msgInfo & "<li>学号" & iID & "成绩已经修改"
end if
end if
%>
<%
'■----------------------------------------------------------------■
'| /-/-/-/-/-->> 本页相关函数 <<--/-/-/-/-/ {Coding by Chfeng.Wu} |
'■----------------------------------------------------------------■
'↓ ↓
'├//记录存在判定
Function iExistRecord (esql)
rec.Open eSql,Conn,1,3
If Not rec.Eof Then
iExistRecord = True
Else
iExistRecord = False
End If
rec.Close
End Function
'↑ Function End   ↑
'■----------------------------------------------------------------■
'
%>






...全文
49 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xxrl 2003-09-28
  • 打赏
  • 举报
回复
以后为了你调试方便,请不要用insert语法,了解就行了,没必要在这个地方用,多累啊,程序员本身就够累的了,还给自己找麻烦?用RS.ADDNEW,以后.
不老书生 2003-09-28
  • 打赏
  • 举报
回复
ssql = "insert into studentinfo (CollegeNo,PassWord,regDT,zhuanye,name) values("&iID&",'123456',"&iDT&","&icZY&","&iName&")"


----》

ssql = "insert into studentinfo (CollegeNo,PassWord,regDT,zhuanye,name) values('"&iID&"','123456','"&iDT&"','"&icZY&"','"&iName&"')"
angelheavens 2003-09-28
  • 打赏
  • 举报
回复
给分
angelheavens 2003-09-28
  • 打赏
  • 举报
回复
ssql = "insert into studentinfo(CollegeNo,PassWord,regDT,zhuanye,name) values("&iID&",'123456','"&iDT&"','"&icZY&"','"&iName&"')"
angelheavens 2003-09-28
  • 打赏
  • 举报
回复
兄弟
如果你有字符型数据应该用单引号括起来
象iName的值
你数据库字段类型估计就是字符型的

28,391

社区成员

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

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