【发布时间】:2013-10-14 13:18:35
【问题描述】:
我在同一个文件夹中有两个文件,例如:
Example
|-connect.asp
|-default.asp
connect.asp 包含:
<%
'declare the variables
Dim Connection
Dim ConnString
'define the connection string, specify database driver
ConnString="DRIVER={SQL Server};SERVER=myServername;UID=myUsername;" & _
"PWD=myPassword;DATABASE=myDatabasename"
'create an instance of the ADO connection and recordset objects
Set Connection = Server.CreateObject("ADODB.Connection")
'Open the connection to the database
Connection.Open ConnString
%>
并且 default.asp 包含:
<!-- #include virtual="connect.asp" -->
<%
Dim Recordset
Set Recordset = Server.CreateObject("ADODB.Recordset")
%>
但是当我运行 localhost/example 我得到一个错误:
处理 URL 时服务器发生错误。请 联系系统管理员。如果您是系统管理员 请单击此处了解有关此错误的更多信息。
如果我不使用包含文件,并将其全部写入一个文件,那么它可以工作。
如何解决这个错误?
【问题讨论】:
-
如果您有权访问您的服务器,此页面可能会帮助您获得更多有用的错误消息chestysoft.com/asp-error-messages.asp
-
您应该关闭 IE 中的友好错误消息,并确保服务器正在发送详细的错误消息,以便我们可以获得更有意义的错误消息。或者,编写一些错误捕获代码并在某处记录详细的错误消息 - 无论哪种方式了解特定错误都将有助于获得更有意义的答案。
标签: sql-server-2008 asp-classic