I'm currently working on a web interface using asp/sql server. Basically, it gets user input and then inserts a bunch of records into a couple different databases. (on different servers)First thing I do is open a connection at the top of the page. Everything works fine for the first little while, but then after a couple thousand queries (selects, inserts), it just dies on me with the following error:Microsoft OLE DB Provider for SQL Server error '80004005' [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. insertNewItem.asp, line 618
If I comment line 618 out, then the script runs fine.(Keep in mind this is nested within several loops, line 618 will get executed a couple thousand times during the script)My connections are opened at the top of the page and never closed/reopened, yet the connection error is thrown 3/4 of the way through the script, after hundreds of inserts have taken place on that same connection. The connection error is being thrown when trying to process a query, NOT when I initially open the connection.The same query runs perfectly fine the first several hundred/thousand times, but then eventually throws an error. If I enter an item that requires much fewer inserts, I do not get this error.'Corp is the name of my main connection'Config is a connection to a secondary servercheckCMenupriceQuery = "SELECT * FROM C_MenuPrice WHERE Generation = " & rsGen("Generation") & " AND List = " & rsList("List") & " AND MenuID = " & menuIDrsCheck.Open checkCMenupriceQuery, Corp '<---###Line 609'Check if this item already exists, and if not, insert itif rsCheck.eof then menuPriceQuery = "INSERT INTO C_MenuPrice (Generation, List, MenuID, Price, StoreNo, Status) VALUES(" & rsGen("Generation") & ", " & rsList("List") & ", " & menuID & ", " & sprice & ",0,0)" if b = 0 then response.write menuPriceQuery & "<BR>" Corp.Execute(menuPriceQuery) '<---###Line 618 else response.write menuPriceQuery & "<BR>" 'Config.Execute(menuPriceQuery) end ifelse
I have been stuck on this problem for quite some time now. It does not seem like a timeout issue, but I have taken some precautions to be safe. My connection and command timeouts, as well as the server.ScriptTimeout are all set to 600. (The script fails within a minute or two)