ADODB.连接(0x800A0E78)
在 MSSQL 2000 上工作的原始连接字符串:
提供商=SQLOLEDB.1;保留安全信息=True;用户ID=XXXXXXXX;初始目录=IntranetApps;数据来源=MS;使用程序准备=1;自动翻译=真;数据包大小=4096;工作站ID=数据写入器;密码=XXXXXXXX';
新的连接字符串不适用于 MSSQL 2008:
提供商=SQLNCLI10;服务器=PR-NB-CIS011\SQLEXPRESS;数据库=IntranetApps;Uid=XXXXXXXX;Pwd=XXXXXXXX;
我尝试将提供程序更改为 SQLNCLI10.1,没有提供程序,...
过去我解决过同样的问题,但是天啊,我现在不记得了。我认为需要安装一些提供程序,但我现在找不到任何相关信息。
有代码女巫抛出异常:
this.connection = new ActiveXObject("ADODB.Connection");
this.connection.ConnectionString = this.conString;
try {
this.connection.Open;
}
catch(e){
Response.write("Chyba pri pripojeni na db.");
return false; // pokud dojde k chybe pri pripojovani k databazi, pak fce vraci false, jinak true
}
Original connectionstring whitch working on MSSQL 2000:
Provider=SQLOLEDB.1; Persist Security Info=True; User ID=XXXXXXXX; Initial Catalog=IntranetApps; Data Source=MS; Use Procedure for Prepare=1; Auto Translate=True; Packet Size=4096; Workstation ID=datawriter; Password=XXXXXXXX';
New connectionstring which not working on MSSQL 2008:
Provider=SQLNCLI10;Server=PR-NB-CIS011\SQLEXPRESS;Database=IntranetApps;Uid=XXXXXXXX;Pwd=XXXXXXXX;
I tryed change provider to SQLNCLI10.1, without provider, ...
Once in past i solved same problem, but hell, i don't remember it now. I thing that there was needed install some provider, but i can find nothing about it now.
There is code witch throw exception:
this.connection = new ActiveXObject("ADODB.Connection");
this.connection.ConnectionString = this.conString;
try {
this.connection.Open;
}
catch(e){
Response.write("Chyba pri pripojeni na db.");
return false; // pokud dojde k chybe pri pripojovani k databazi, pak fce vraci false, jinak true
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果这确实是连接字符串问题,您应该:
";Data Source=PR-NB-CIS011\SQLEXPRESS;"
而不是";Server= PR-NB-CIS011\SQLEXPRESS;"
If this really is a connection string problem, you should:
";Data Source=PR-NB-CIS011\SQLEXPRESS;"
instead of";Server=PR-NB-CIS011\SQLEXPRESS;"
在这种情况下,您的连接字符串中指定的服务器似乎不存在,未运行或您的用户帐户已经提供没有足够的权限。
要尝试的事情:
1) 您的连接字符串对于 SQL Express 2008 的格式不正确,请尝试以下操作:
2) 当您打开 Management Studio 时,尝试使用连接字符串的用户名和密码进行连接。有时,这可以使查找和跟踪权限问题变得更快、更容易。
3) 如果您使用 SQL Server 用户帐户登录,请确保启用了 SQL Server 和 Windows 身份验证。为此,请在 SQL Management Studio 中右键单击服务器“属性”,然后在“安全”选项卡上选中“SQL Server 和 Windows 身份验证模式”
In this case it appears the server specified in your connection string does not exist, is not running or the user account you've provided doesn't have sufficient permissions.
Things to try:
1) Your connection string is not correctly formatted for SQL Express 2008, try this:
2) When you open Management Studio, try and connect with the username and password of your connection string. This sometimes makes it quicker and easier to find and trace permissions issues.
3) If you're logging in with a SQL server user account, make sure you have SQL server and windows authentication enabled. To do this, in SQL Management Studio, right click the server, Properties, and on the Security tab, check 'SQL Server and Windows Authentication mode'