Server 2008 上的经典 ASP SQL 2008

发布于 2024-07-09 06:46:18 字数 568 浏览 8 评论 0原文

我目前正在将我的一个客户站点迁移到 Windows Server 2008 和 SQL 2008 设置,但从该站点连接到数据库时遇到了巨大的问题。

我已将数据库从 SQL 2k 备份恢复到 SQL 2008 服务器,我已正确设置用户,并且可以在 Management Studio 中以该用户身份登录。 我已经复制了站点 .asp 文件,当没有数据库访问时,这些文件可以正常加载。 但是当我尝试访问数据库时,它失败并显示“用户登录失败......”。

我已经重置了密码,创建了新用户,将连接字符串从 OLEDB 更改为 SQL Native Client,然后又更改回来,但仍然出现错误。 我什至设置了一个虚拟数据库和用户,但仍然遇到同样的问题。

有谁知道为什么会发生这种情况? SQL 或 Windows 中是否有我缺少的设置?

我已经在这里呆了几个小时了,非常感谢任何想法。

更新:如果我在连接字符串中输入了错误的登录详细信息,我会在 conn.open 上收到错误,但如果我输入正确的登录详细信息,我会在 cmd.activeconnection = conn 上收到错误。 不确定这是否有帮助。

I am currently migrating one of my clients sites to a windows server 2008 and SQL 2008 setup, but I am having massive problems with connecting to the database from the site.

I have restored the database from a SQL 2k backup into the SQL 2008 server, I have setup the user correctly and can login as that user in management studio fine. I have copied over the site .asp files which load fine when there is no database access. But when i try to access the database it fails with "Login Failed for user......".

I have reset the passwords, created new users, changed the connectionstring from OLEDB to SQL Native Client and back again but keep getting errors. I have even setup a dummy database and user and still have the same problem.

Does anyone know of a reason why this could be happening? Is there a setting in SQL or windows that I am missing?

I have been at this for hours and would really appreciate any ideas.

UPDATE : If I put the wrong login details in the connection string I get the error on conn.open but if I put in the correct login details I get the error on cmd.activeconnection = conn. Not sure if that helps.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

她说她爱他 2024-07-16 06:46:18

我刚刚在使用 Windows 2008 和 SQL Server 2008 时遇到了一些类似的问题。根据我的记忆,这些是我们使用 SQL 身份验证启用连接所经历的步骤

  1. 以管理员身份登录到 SQL Server,更改属性服务器的属性以允许混合模式身份验证(SQL 身份验证和 Windows 身份验证)

  2. 重新启动SQL Server 服务

  3. 使用 SQL Server 配置管理器确保已启用协议 (TCP/IP)

我们在连接方面遇到了很多防火墙问题。 有时,用户登录失败并不是问题的真正原因。 我通常创建一个扩展名为 udl 的文件来测试连接性。

当您登录 SQL Server 时,您使用 Windows 身份验证吗?

希望这可以帮助。

I have just had a few similar problems with our Windows 2008 and SQL Server 2008. From what i can remember these are the steps we went through to enable connectivity using SQL Authentication

  1. Logon to the SQL Server as an Administrator, change the properties of the server to allow mixed mode authentication (SQL Authentication and Windows Authentication)

  2. Restart the SQL Server service

  3. Using the SQL Server Configuration manager ensure that the protocols are enalbed (TCP/IP)

We had quite a few firewall issues, regarding conectivity. Some times the Logon Failed for user wasn't the true cause of the problem. I usually create a file with a udl extension to test for connectivity.

When you logon to your SQL Server do you use windows authentication?

Hope this helps.

離人涙 2024-07-16 06:46:18

听起来像是 ADO 的问题。 您是否尝试过安装最新版本或刷新安装(如果您已经拥有最新版本)?

编辑:抱歉,没有注意到您正在运行 Windows Server 2008。该版本附带 Windows DAC 6.0,据我所知,无法重新安装。 由于您的 UDL 文件可以工作,我唯一能想到的就是确保 ASP 站点的用户身份可以访问包含 DAC dll 的文件夹。 您可以尝试从 Sysinternals 运行 FileMon 并检查对这些文件的访问被拒绝的条目。

Sounds like a problem with ADO. Have you tried installing the latest version or refreshing the install if you already have the latest one?

Edit: Sorry, didn't notice you were running Windows Server 2008. That version comes with Windows DAC 6.0, and that can't be reinstalled as far as I know. Since your UDL file works, the only thing I can think of is to make sure the user identity for your ASP site has access to the folders containing the DAC dlls. You can try running FileMon from Sysinternals and checking for access denied entries to those files.

痴意少年 2024-07-16 06:46:18

我得到了解决方案,对于经典的 asp 连接字符串是:

myConnection.ConnectionString = "Driver={SQL Server};Server=xxx.xxx.xxx.xxx,1533;Database=mydb;Uid=user123;Pwd=user123d;"

I got the solution, for classical asp connection string is:

myConnection.ConnectionString = "Driver={SQL Server};Server=xxx.xxx.xxx.xxx,1533;Database=mydb;Uid=user123;Pwd=user123d;"
最佳男配角 2024-07-16 06:46:18

我也遇到过类似的问题。

我通过连接字符串从: 更改

DRIVER={SQL Server};SERVER=80.82.xxx.xxx;DATABASE=mydatabasename;UID=myusername;PWD=mypassword

为:

Provider=SQLNCLI10.1;SERVER=80.82.xxx.xxx;DATABASE=mydatabasename;UID=myusername;PWD=mypassword

它有效。

您可能想尝试不同的提供商设置。

I've been having a similar problem.

I changed by connection string from this:

DRIVER={SQL Server};SERVER=80.82.xxx.xxx;DATABASE=mydatabasename;UID=myusername;PWD=mypassword

To this:

Provider=SQLNCLI10.1;SERVER=80.82.xxx.xxx;DATABASE=mydatabasename;UID=myusername;PWD=mypassword

And it worked.

You may want to play around with different provider settings.

带上头具痛哭 2024-07-16 06:46:18

由于您将数据库恢复到新服务器,您的数据库上现在可能有一个孤立用户。 您需要将孤立用户重新连接到服务器登录名。 有关详细信息,请参阅如何将现有 SQL Server 登录名连接到同名的现有 SQL Server 数据库用户

Since you restored your database to a new server, you probably now have an orphan user on your database. You need to reconnect the orphan user to a server login. See How to connect an existing SQL Server login to an existing SQL Server database user of same name for details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文