All...
I've been searching for hours and am at my wits end. We're simply trying to get a legacy app running for a client on IIS 7 - our transition to .NET for this piece isn't yet complete.
I have the same four lines of ADODB.Connection code in my initial login page (not in a function) and the connection works just fine. On all subsequent pages, the connection is returned from a "function" and no matter what I do - I get a "Login failed" error. It appears, for some reason, the connection handle coming back from the function isn't valid - although it's worked for many, many years with IIS 6. My gut tells me this is some obscure permissions thing dealing with scope or something. Any help would be GREATLY appreciated.
Code, when in each ASP page works:
dim oConn
set oConn = server.CreateObject("ADODB.Connection")
with oConn
.ConnectionString = Session("ConnectString")
.Open
end with
...
oRSLogin.Open userSql, oConn ' NO ERROR - Works
Code, when in a function that DOES NOT work
function GetUserConn()
set oConn = server.CreateObject("ADODB.Connection")
oConn.ConnectionTimeout = 900
with oConn
.ConnectionString = session("connectString")
.Open
end with
GetUserConn = oConn
end function
oConn = GetUserConn()
oSRList.Open sSRSql, oConn ' THIS IS WHERE I GET AN ERROR
Thanks for any help!