简体   繁体   English

尝试连接到 SQL Server 时出现经典 ASP 错误 80004005

[英]Classic ASP Error 80004005 when trying to connect to SQL Server

I am trying to connect a classic ASP webpage to SQL Server 2008, and whatever I do I keep getting this...我正在尝试将一个经典的 ASP 网页连接到 SQL Server 2008,无论我做什么,我都会收到这个......

error '80004005'

It then proceeds to tell me the line where the error is, and that is all.然后它继续告诉我错误所在的行,仅此而已。

My connection code is as follows我的连接代码如下

<%
Dim Stock
Dim Stock_cmd
Dim Stock_numRows

Set Stock_cmd = Server.CreateObject ("ADODB.Command")
Stock_cmd.ActiveConnection = MM_DVerto_STRING
Stock_cmd.CommandText = "SELECT Location, Part_Number FROM dbo.Stock_Header WHERE Part_Number = ?" 
Stock_cmd.Prepared = true
Stock_cmd.Parameters.Append Stock_cmd.CreateParameter("param1", 200, 1, 15, Stock__MMColParam2) ' adVarChar

Set Stock = Stock_cmd.Execute
Stock_numRows = 0
%>

Connection File连接文件

<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO" 
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_DVerto_STRING
MM_DVerto_STRING = "dsn=CMD SQL;uid=web;"
%>

Any help would be greatly accepted!任何帮助将被极大地接受!

Error 80004005 is:错误 80004005是:

Data source name not found and no default driver specified未找到数据源名称且未指定默认驱动程序

Most likely your web server is missing an ODBC connection named CMD SQL .很可能您的 Web 服务器缺少名为CMD SQL的 ODBC 连接。

If not, here is the full list of possible causes from that MSDN link:如果没有,这里是来自该 MSDN 链接的可能原因的完整列表:

  • The Microsoft Windows NT 4.0 or Windows 2000 user account that is used to process the request for the ASP page does not have sufficient permissions to read the registry key that stores the specified DSN's configuration information.用于处理 ASP 页请求的 Microsoft Windows NT 4.0 或 Windows 2000 用户帐户没有足够的权限来读取存储指定 DSN 的配置信息的注册表项。
  • The System ODBC DSN that is specified in the ADO connection string does not exist on the IIS server. IIS 服务器上不存在 ADO 连接字符串中指定的系统 ODBC DSN。
  • The ASP Application or Session variable that is initialized in the ASP application's Global.asa file (or in an ASP page that is accessed before the page that contains the database connection code) is used to specify the ADO connection string.在 ASP 应用程序的 Global.asa 文件(或在包含数据库连接代码的页面之前访问的 ASP 页)中初始化的 ASP 应用程序或会话变量用于指定 ADO 连接字符串。 This connection string variable is not initialized when the code to open the database connection is run.运行打开数据库连接的代码时,未初始化此连接字符串变量。 To confirm this, add a Response.Write statement before the line of code that opens the database connection to display the connection string that is stored in the variable.要确认这一点,请在打开数据库连接以显示存储在变量中的连接字符串的代码行之前添加 Response.Write 语句。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP经典应用使用Azure SQL服务器时,Microsoft OLE DB Provider for ODBC Drivers错误&#39;80004005&#39; - Microsoft OLE DB Provider for ODBC Drivers error '80004005' when asp classic app use azure sql server 尝试连接到 SQL Server 时出错 - Error when trying to connect to SQL Server 尝试连接到Azure中的SQL Server时在signalR ASP.NET中出现错误 - Error when in signalR ASP.NET when trying to connect to SQL server in Azure ASP经典SQL Server 2005无法连接 - asp classic sql server 2005 can't connect 通过经典ASP连接到SQL Server(Windows身份验证) - Connect to SQL server (Windows Authentication) via Classic ASP 尝试连接到SQL Server数据库时出现“ SqlException未处理”错误 - 'SqlException was unhandled' error when trying to connect to SQL Server database 经典ASP异常SQL错误 - Classic ASP bizarre SQL error sql server 2000错误,尝试连接到sql server 2005时出错 - sql server 2000 error, error trying to connect to sql server 2005 Microsoft OLE DB Provider for SQL Server错误'80004005' - Microsoft OLE DB Provider for SQL Server error '80004005' SQL Server在ASP经典版[Microsoft]中执行SQL存储过程时出错[SQL Server Native Client 11.0] [SQL Server]错误 - SQL Server Error executing SQL stored procedure in ASP classic [Microsoft][SQL Server Native Client 11.0][SQL Server] Error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM