James wrote:
We've had a recurring problem where all of a sudden we get a DBMSSOCN
General Network Error on any page that connects to SQL Server. Then
we have to reboot the server and everything works fine again, for a
few more hours and then we have the same problem. Someone suggested
adding ";Network Library=DBMSSOCN" to our connection strings. I've
tried to figure out exactly what this does and why not having it
would be a problem. Any ideas? Thanks.
If you are not using explicit connection objects, you could be disabling
connection pooling
http://support.microsoft.com/?kbid=271128
whch floods your sql server with excess connection, causing it to fail to
respond:
http://support.microsoft.com/?kbid=328476
Do not use this syntax:
set rs=createobject("adodb.recordset")
rs.Open strSQL, strConnectString ...
Do this instead:
set cn=createobject("adodb.connection")
cn.Open strConnectString
set rs=createobject("adodb.recordset")
rs.Open strSQL, cn ...
Another possible gotcha would be:
set cn=createobject("adodb.connection")
cn.Open strConnectString
set rs=createobject("adodb.recordset")
rs.ActiveConnection=cn
rs.Open strSQL
Without the use of the "set" keyword, you are causing a new implict
connection to be created instead of utilizing the already-open cn connection
(remember, the default property of a connection object is its ConnectString.
Without "set", the vbscript compiler thinks you want the default property,
not the object itself, so it uses that ConnectString to create a new
implicit connection behind the scenes).
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.