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

查看:26
本文介绍了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.

这是代码

<%
const database_dsn="PROVIDER=SQLNCLI10; SERVER=FR-2626SQLLOP;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...

我只是不知道该怎么办..我怎么会出错?

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

谢谢乔纳森

推荐答案

而且不是死马,但我正在针对 Oracle 数据库做类似的事情,我有两个幻像问题,我尚未确定根本原因但有两件事让他们消失了.
1. 将查询中的所有列命名为任何计算的别名(sum、count、avg 等),这样您的查询将变为

And not to kick a dead horse but I'm doing something similar against an Oracle database and I've had two phantom problems I have yet to identify root cause but here's two things that made them go away.
1. Name all columns in a Query and Alias any that are calculated (sum, count, avg, etc.) So your query would become

req = "Select count(*) NumRows From tblArticleList"

2.将我的查询字符串包装在对 cstr 的调用中会导致 result.EOF 标志被正确填充,而不是返回一个空值或 null 值,从而导致一个简单的 DO WHILE NOT result.EOF Some Action LOOP 创建一个无限循环,直到 Web 请求时间到.所以例如

2. Wrapping my query string in a call to cstr caused the result.EOF flag to be populated correctly rather than be returned with an empty or null value causing a simple DO WHILE NOT result.EOF Some Action LOOP to create an infinite loop until the web request timed out. So e.g.

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

如果您遇到困难并且找不到原因,没有什么大不了的,只是一些提示.不过,请遵循上面的调试建议,这是很好的信息.

Nothing major just a couple tips if you get stuck and can't find out why. Follow the debugging advice above though, that's good info.

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

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