从 ASP 访问 SQL 数据库

发布于 2024-10-03 04:30:35 字数 546 浏览 0 评论 0原文

我有两个网站 OLD.com(经典 ASP)和 NEW.com(ASP.NET) - 每个网站都有自己的 SQL 数据库,可以很好地访问。但是我需要访问 OLD.com 和NEW.com 数据库来自用 OLD.com 编写的经典 asp。

这是我在 OLD.com 中使用的代码来访问 NEW.com 的数据库:

Dim oCN
Set oCN = Server.CreateObject("ADODB.Connection")
oCN.Open "Provider=SQLOLEDB;Data Source=NEW.COM DB IP;Initial Catalog=dbname;User ID=uname;Password=pAss;Pooling=False"

这在我的本地 IIS 计算机上运行得很好,但是当我将其上传到 OLD.com 时,它超时并给出此错误:

Active Server Pages 错误“ASP 0113”

脚本超时

这是怎么回事?怎么了?

非常感谢您的帮助

I have two websites OLD.com (classic ASP) and NEW.com (ASP.NET) - each site has its own SQL database which it can access just fine. However I need to access the OLD.com & NEW.com databases from classic asp written in OLD.com.

Here is the code i'm using in OLD.com to access NEW.com's DB:

Dim oCN
Set oCN = Server.CreateObject("ADODB.Connection")
oCN.Open "Provider=SQLOLEDB;Data Source=NEW.COM DB IP;Initial Catalog=dbname;User ID=uname;Password=pAss;Pooling=False"

This works just fine on my local IIS machine, but when I upload it to OLD.com it times out and gives this error:

Active Server Pages error 'ASP 0113'

Script timed out

How can this be? Whats wrong?

Many thanks for your help

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

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

发布评论

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

评论(1

奶气 2024-10-10 04:30:35

从经典的调试问题开始 - OLD.com 是否可以通过网络访问数据库;如果该服务器上有查询分析器,您可以使用该用户名和密码打开 sql 连接吗?用户名和密码输入是否正确等等。

那么您要执行什么查询?该错误表明脚本超时 - 您是否正在尝试检索比超时时间更长的内容 - 查询效率低下等。

编辑 - 例如 - 可以从旧服务器访问新数据库的 IP 地址吗?是否有防火墙阻止从一个站点到另一个站点的 sql 连接(将允许通过端口 80 进行 Web 流量,不确定 sql 连接将通过哪个端口,但很可能被旧的或新的端口阻止)托管服务提供商

Start with the classic debugging questions - does the OLD.com have network access to the database; if you have query analyser on that server can you open a sql connection using that username and password; are username and password typed correctly etc.

What query are you then performing? The error indicates a script timeout - are you trying to retrieve something that is taking longer than the timeout - inefficient query, etc.

EDIT - for example - can the IP address of the new database be accessed from the old server? Is there a firewall in place preventing the sql connection from one site to the other (web traffic will be allowed over port 80, not sure what port the sql connection will be going over, but may well be being blocked by either your old or new hosting providers

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