Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 26542

Random 0x80004005 Error Messages in ASP Page

$
0
0

I have the following setup:

SQL Server 2008 64bit on Windows Server 2008 Enterprise 64bit

IIS7 on Windows Server 2008 64bit

I have an ASP page that builds a report from multiple tables in the database, so there are many queries being executed on a ADODB Connection set into a ADODB recordset.  I know the connection works becuase it is the same that is being used in previous pages leading up to the report, and when it fails in the report is fails at different spots on the page somewhat randomly.  I've tried SQLOLEDB, SQLOLEDB.1 and SQLNCLI10 as providers in the connection string and all seem to fail at some point, though with different error messages.

When using SQLOLEDB or SQLOLEDB.1:

Set Conn = Server.CreateObject("ADODB.Connection")
Connect = "Provider=SQLOLEDB.1; Data Source=SQLSERVERNAME; Initial Catalog=DBName; User ID=username; Password=password; Network Library=dbmssocn;"
Conn.Open Connect

For SQLOLEDB sometimes I would get a message :Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

The line that it appeared on would always be different, sometimes the error message wouldn't appear but the page would go "blank" and go on processing forever.  There are no failed logon attempts showing up on SQL Server or any other messages.

 

When using SQLNCLI10:

Set Conn = Server.CreateObject("ADODB.Connection")
Connect = "Provider=SQLNCLI10; Address=192.168.168.168;Database=DBName; Uid=usernamel; Pwd=password; Network Library =dbmssocn;"
Conn.Open Connect

For SQLNCLI10 I would receive the message:Microsoft SQL Server Native Client 10.0 (0x80004005)
TCP Provider: Only one usage of each socket address (protocol/network address/port) is normally permitted.

I've played around with the connection strings to try different ways of accessing - dropping the network library to try named pipes, specifying the TCP port to connect to, and others but none seem  to work.  The kicker is if I open a browser on the web server itself, this page will run to completion and display properly.  It is only when I try to run it from a different workstation does it behave this way (any workstation).

The code some something like this:

set rstSample = conn.execute("select * from Table1)
While not rstSample.EOF
       Do a lot more calls to various tables based on current record - always conn.execute(sqlstatment)
       For i = 0 to 12 - build report data for each month
             Do more calls and assign more variables
       Next
       Assign values to varialbes
       Output Variables in HTML
       rstSample.MoveNext
Wend

If I change the main select statement to "Select Top 30 PERCENT * from Table1) the report will run normally.
If I change the nested loop to do only 6 months of tallying the report will run normally.
If I run it from the webserver itself the report will run normally.
SQL Trace shows no malformed SQL expressions.
sp_who on Database generally shows only half a dozen or so connections when report is being run.
There are about 100 references to conn.execute within the main loop, and there are approximately 30 records returned on the inital select statement.
Changed conn.CommandTimeout = 600
Server.ScriptTimeout = 3600
Can view TCP connections on SQL Server and there aren't 4000+ connections active.
There is no security associated with the website, its done internally on the site.

The report seems to be causing problems on the IIS server as everywhere else things seem fine.  This report has ran successfully for years on previous versions of IIS/Windows/SQL Server, but now won't in the current environment under these conditions.

Is there something I'm missing in the IIS configuration that would help on this issue?


Viewing all articles
Browse latest Browse all 26542

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>