不显示ASP错误 [英] asp errors not displayed

查看:160
本文介绍了不显示ASP错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我提出的SQL数据库从一台服务器到一个新的(独立/附后)

I have moved an sql database from one server to a new one (detached/attached)

现在我遇到一些奇怪的行为,因为它不工作,但不显示错误。

Now i experience some strange behavior as it does not work but NO error is displayed.

这是code

<%
const database_dsn="PROVIDER=SQLNCLI10; SERVER=FR-2626\SQLLOP;DATABASE=Lop;Uid=admin-sql;Pwd=xxxx;" 

response.write "Step 0//"

set conn=server.CreateObject("ADODB.Connection")
set RS=server.CreateObject("ADODB.Recordset")

conn.Open database_dsn

response.write "Step 1//"
req = "Select count(*) From tblArticleList"

response.write "Step 2//"
set RS = conn.Execute(req)

response.write  "Step 3//"

%>

程序停止在步骤2;然后什么都没有,没有显示错误...

The program stops at Step 2; then nothing, no error is displayed...

我只是不知道该怎么do..How我可以得到一些错误?

I just don t know what to do..How can i get some error?

谢谢
乔纳森

推荐答案

您需要将错误检查code,找出实际的错误可能。
我建议你​​改变code,像这样:

You need to place error checking code to find out what the actual error might be. I would suggest that you change you code like so:

<%
const database_dsn="PROVIDER=SQLNCLI10; SERVER=FR-2626\SQLLOP;DATABASE=Lop;Uid=admin- sql;Pwd=xxxx;"

'Its very important to add this line!!! '
On Error Resume Next
'Its very important to add this line!!! '

response.write "Step 0//"

set conn=server.CreateObject("ADODB.Connection")
set RS=server.CreateObject("ADODB.Recordset")

conn.Open database_dsn

if err.number<>0 then
    response.write err.description
end if

response.write "Step 1//"
req = "Select count(*) From tblArticleList"

response.write "Step 2//"
set RS = conn.Execute(req)

if err.number<>0 then
    response.write err.description
end if

response.write  "Step 3//"

%>

这篇关于不显示ASP错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆