使用ADODB.Recordset当实例无效 [英] Invalid Instance when using ADODB.Recordset

查看:161
本文介绍了使用ADODB.Recordset当实例无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从一台服务器迁移到另一台。我已经恢复了我的数据库,并重新建立自己的网站。然而由于移植我的网站将无法连接到我收到以下错误数据库:

I have migrated from one sever to another. I have restored my database and reset up my website. Since migrating however my website will not connect to the database I am getting the following error:

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Invalid Instance()).]Invalid connection.

我的连接字符串的形式

My connection string is in the form of

CON_STRING = "Provider=SQLOLEDB;Data Source=myserver;Initial Catalog=mydb;User Id=user;Password=password"

的错误被抛出的code的第二线以下

The error is being thrown on the second line of the code below

Set rsBCT = Server.CreateObject("ADODB.Recordset")
rsBCT.ActiveConnection = CON_STRING

会不会有什么设置,将需要改变对这项工作的服务器上是否明智?
我怎么能尝试和调试什么错误。我所有的它们使用web.config文件中的其他应用程序正在连接的罚款。我可以采取哪些故障排除步骤?

Would there be anything settings wise on the server that would need changing for this work? How can I try and debug what is going wrong. All my other applications which use web.config files are connecting fine. What troubleshooting steps can I take?

推荐答案

在连接字符串中使用服务器的实例名称:

Use the instance name of the server in the connection string:

CON_STRING = "Provider=SQLOLEDB;Data Source=myServer\myInstance;Initial Catalog=mydb;User Id=user;Password=password"
----------------------------------------------------^^^^^^^^^^^

这篇关于使用ADODB.Recordset当实例无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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