列名不明确 asp程序

2014 年 1 月 29 日1,6710

答案1:<%

if Session("login")=true then

if Session("userright")="reader" then

Response.Write("<tr><td align=center height=30><font color=red><b>您当前的身份是读者,没有此项权限!</b></font><br></td></tr>")

elseif Session("userright")="manager" then

if action = "delete" and bclass <> "" then

strSQL1 = "delete from book where bclass=" & bclass

strSQL2 = "delete from bookclass where bclass=" & bclass

con.execute(strSQL1)

con.execute(strSQL2)

Response.Write("<tr><td height=30 colspan=2 align=center><font color=red><b>记录删除成功!</b></font></td></tr>")

Response.Write("<tr><td height=30 colspan=2 align=center><a href=Bookclass.asp>返回</a></td></tr>")

elseif bclass<>"" then

strSQL = "select * from book,bookclass where book.bclass=bookclass.bclass and bclass=" & bclass

Set objRS = Server.CreateObject("ADODB.Recordset")

objRS.Open strSQL,con,adOpenStatic

if not objRS.EOF then

%>

在运行陈旭是老是显示错误类型:

Microsoft OLE DB Provider for SQL Server (0x80040E14)

列名 'bclass' 不明确。

/tsg/Bookclassdelete.asp, 第 35 行(objRS.Open strSQL,con,adOpenStatic)请高手帮忙解决

答案2:strSQL = "select * from book,bookclass where book.bclass=bookclass.bclass and bclass=" & bclass

这里的and bclass=" & bclass由于你两个表中都有bclass 这个列名,所以不知道你指的是哪个,应写成and book.bclass=" & bclass 或 and bookclass.bclass=" & bclass

如果本信息还未帮到您,请在这里搜索:

相关知识:

0 0