views:

25

answers:

2

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
A: 

Take a look at these. They may be of some help

http://support.microsoft.com/kb/165671

http://www.connectionstrings.com/sql-server

renick
The first is interesting except that I already am able to detect the error when I use my existing code, and I already know my connection string is valid (or seems that way) since I am able to open connections in VB6 using the same string. The latter is not really relevant; I'm not using that data provider and already have a properly formatted connection string.
Brian
I was just trying to suggest that maybe another provider might work. Straight OLEDB for example. If it is up to you it may help in determining the fault. Sometimes a timeout error may be caused by a deeper error and another driver may reveal it. Just thinking out loud.
renick
Creating a dsn and connecting to that using the tool in the first page still causes a timeout. The latter is intended for use with a .net data provider, which I'm not sure is appropriate in an asp class application.
Brian
Note that the dsn does work in VB6 and Excel, though.
Brian
A: 

The problem was that NETWORK SERVICE needed lots of permissions on C:\Users\USERNAME\AppData\Local\Temp .

Brian
Note: This fixes some stuff, but isn't the only username involved.
Brian
Other temp directories like `c:\windows\temp` may be involved, too. It varies based on whether it is run in debug mode, among other things.
Brian