无法仅从 asp 连接到 sql 数据库
在 VB6 程序中:
Dim conn As Object
Set conn = CreateObject("ADODB.Connection")
conn.Open "DRIVER={SQL Server}; Server=(local)\aaa; Database=bbb; UID=ccc; PWD=ddd"
在 ASP 程序中:
Sub ProcessSqlServer(conn)
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={SQL Server}; Server=(local)\aaa; Database=bbb; UID=ccc; PWD=ddd"
VB6 程序可以运行,而 ASP 程序则不能(请参见下面的错误)。我尝试检查事件日志是否有错误,但没有发现任何错误。或者更准确地说,我确实发现了本地激活权限错误,但是当我通过组件服务工具将网络服务的本地启动/激活权限添加到机器调试管理器后,这个问题就得到了修复。
错误:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver]Timeout expired
In a VB6 program:
Dim conn As Object
Set conn = CreateObject("ADODB.Connection")
conn.Open "DRIVER={SQL Server}; Server=(local)\aaa; Database=bbb; UID=ccc; PWD=ddd"
In an ASP program:
Sub ProcessSqlServer(conn)
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={SQL Server}; Server=(local)\aaa; Database=bbb; UID=ccc; PWD=ddd"
The VB6 program works, the ASP program does not (see error below). I tried checking the event log for errors, but found nothing. Or more precisely, I did find local an activation permission error, but this was fixed once I added local launch/activation permission for Network Service to the Machine Debug Manager via the component services tool.
Error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver]Timeout expired
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题在于
NETWORK SERVICE
需要C:\Users\USERNAME\AppData\Local\Temp
上的大量权限。The problem was that
NETWORK SERVICE
needed lots of permissions onC:\Users\USERNAME\AppData\Local\Temp
.