Connection String/Network Library

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • James

    Connection String/Network Library

    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=DBMSSOC N" 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.


  • Curt_C [MVP]

    #2
    Re: Connection String/Network Library

    Building your connection string


    Beyond that it's most likely NOT the connection string, its either the
    network communications, unclosed connections, etc.

    --
    Curt Christianson
    Site & Scripts: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "James" <letyoudown@ver izon.net> wrote in message
    news:%23SFtO65B FHA.2676@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > 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=DBMSSOC N" 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.
    >
    >[/color]


    Comment

    • James

      #3
      Re: Connection String/Network Library

      The only reason I tend to think it's the connection string is that we've
      been pretty diligent about closing connections and we were connecting with
      DSNs up until recently without problem. I'll build a connection string this
      way and see how it goes.

      Thanks


      "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
      news:OLKtgQ6BFH A.824@TK2MSFTNG P11.phx.gbl...[color=blue]
      > Building your connection string
      > http://www.darkfalz.com/1059
      >
      > Beyond that it's most likely NOT the connection string, its either the
      > network communications, unclosed connections, etc.
      >
      > --
      > Curt Christianson
      > Site & Scripts: http://www.Darkfalz.com
      > Blog: http://blog.Darkfalz.com
      >
      >
      > "James" <letyoudown@ver izon.net> wrote in message
      > news:%23SFtO65B FHA.2676@TK2MSF TNGP12.phx.gbl. ..[color=green]
      > > 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[/color][/color]
      hours[color=blue][color=green]
      > > and then we have the same problem. Someone suggested adding ";Network
      > > Library=DBMSSOC N" 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.
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Bob Barrows [MVP]

        #4
        Re: Connection String/Network Library

        James wrote:[color=blue]
        > 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=DBMSSOC N" 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.[/color]
        If you are not using explicit connection objects, you could be disabling
        connection pooling
        Microsoft Support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows, Surface, and more.

        whch floods your sql server with excess connection, causing it to fail to
        respond:
        Microsoft Support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows, Surface, and more.



        Do not use this syntax:

        set rs=createobject ("adodb.records et")
        rs.Open strSQL, strConnectStrin g ...

        Do this instead:

        set cn=createobject ("adodb.connect ion")
        cn.Open strConnectStrin g
        set rs=createobject ("adodb.records et")
        rs.Open strSQL, cn ...

        Another possible gotcha would be:
        set cn=createobject ("adodb.connect ion")
        cn.Open strConnectStrin g
        set rs=createobject ("adodb.records et")
        rs.ActiveConnec tion=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.


        Comment

        • James

          #5
          Re: Connection String/Network Library

          Ahh, thank you. I don't believe we ever use any of the syntaxes you
          mentioned, but I will definitely look into that, as I'm not responsible for
          coding all pages.

          This error happened about an hour ago. There were two connection objects on
          a particular page, with the exact same connection string, aside from the
          DBMSSOCN aspect. Before this line was added, the error occurred on the
          opening of the first connection object. The first connection object was
          then changed to reflect that DBMSSOCN, while the second one was accidentally
          overlooked. When the error occurred this time, the first connection did not
          error, but the second one did.

          The page didn't need two connection objects to the same database anyway, so
          that's been fixed...but the fact that the first connection didn't error is
          giving me a glimmer of hope. Perhaps I'm just grasping for any hope I can
          find here, heh.

          Thanks for the assistance thus far...it's much appreciated.

          James



          "Bob Barrows [MVP]" <reb01501@NOyah oo.SPAMcom> wrote in message
          news:%23o4Hum6B FHA.2016@TK2MSF TNGP15.phx.gbl. ..[color=blue]
          > James wrote:[color=green]
          > > 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=DBMSSOC N" 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.[/color]
          > 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.records et")
          > rs.Open strSQL, strConnectStrin g ...
          >
          > Do this instead:
          >
          > set cn=createobject ("adodb.connect ion")
          > cn.Open strConnectStrin g
          > set rs=createobject ("adodb.records et")
          > rs.Open strSQL, cn ...
          >
          > Another possible gotcha would be:
          > set cn=createobject ("adodb.connect ion")
          > cn.Open strConnectStrin g
          > set rs=createobject ("adodb.records et")
          > rs.ActiveConnec tion=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[/color]
          connection[color=blue]
          > (remember, the default property of a connection object is its[/color]
          ConnectString.[color=blue]
          > 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.
          >
          >[/color]


          Comment

          Working...