当前位置:编程学习 > asp >>

请帮忙看一下这段asp代码错在哪里。谢谢!

<html> <head> <title>notitle</title> </head> <body> <% Set conn=Server.CreateObject("ADODB.Connection") sql="Provider=SQLoledb;data source=CNJNCZFILE01;UID=JNOP;PWD=OPJN;Initial Catalog=Jinan;Integrated Security=SSPI" conn.Open sql %> <% exec="select * from DMlist" set rs=server.createobject("adodb.recordset") rs.open exec,conn,1,1 %> </body> </html> thank you very much!!
补充:<html>
<head>
<title>notitle</title>
</head>
<body>
<% 
Set conn=Server.CreateObject("ADODB.Connection") 
sql="Provider=SQLoledb;data source=CNJNCZFILE01;UID=JNOP;PWD=OPJN;Initial Catalog=Jinan;Integrated Security=SSPI" 
conn.Open sql 
%>
<% 
exec="select * from DMlist"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
if not rs.bof and not rs.eof  then
while not rs.eof
     response.write("Dept:"+rs("Dept")+"<br>")
    response.write("Itemcode:"+rs("Itemcode")+"<br>")
    response.write("Chinese Name:"+rs("Chinese Name")+"<br>")
    response.write("English Name:"+rs("English Name")+"<br>")
    response.write("PSP:"+rs("PSP")+"<br>")
    response.write("Period:"+rs("Period")+"<br>")
    rs.movenext
    next
    end if  %>
</body>
</html>
改成这样了,报错:
Microsoft VBScript compilation error '800a041f' 
Unexpected 'Next' 
/default.asp, line 36 
next
追问:没有错误提示,只显示一个空白页。那应该怎么改才能有输出呢?输出查询结果,就是 select * from DMlist   的所有结果

应该怎么写,谢谢。报错信息:

Microsoft VBScript compilation error '800a03f9' 

Expected 'Then' 

/default.asp, line 24 

if not rs.bof and not rs.eof)  then


表dmlist中的字段
Dept , Itemcode, Chinese Name, English Name ,PSP ,PeriondMicrosoft VBScript compilation error '800a0408' 

Invalid character 

/default.asp, line 26 

response.write(“Dept :”rs("Dept ")+“<br>”)
----------^
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,