[DBNETLIB][ConnectionOpen (PreLoginHandshake()).]General network error.


  • Hi,

    I have a classic ASP application that has been running on Win2003,IIS6 and SQL2000 for 3 years without a single error.

    We've just moved to SQL2005 enterprise and we're getting the following intermittent error.

    Microsoft OLE DB Provider for SQL Server error '80004005'

    [DBNETLIB][ConnectionOpen (PreLoginHandshake()).]General network error. Check your network documentation.

    Any ideas where to start?

    giovedì 22 marzo 2007 19:44


  • Hi,

    I've just struggled with this problem for a (now) virtualised database - Kadir Sümerkent's solution at the top of the thread to allow remote access TCP/IP only fixed my problem.  Thanks.


    lunedì 19 luglio 2010 09:56

Tutte le risposte

  • this is a common connection problem and without details like your current sql server configuration and connection string, we just can write our guesses,

    first, if you have not installed latest service pack for sql serer 2005, please install it before trying the following suggestions,

    second, you can check if you have enabled remote connections on sql server, to check this setting go to sql server surface area configuration -> surface area configuration for services and connections -> remote connections and enable remote connections by selection "local and remote connections" and using tcp/ip only.

    if the previous step did not solve your problem, you can check your connection string, please examine the following connection strings,
    for odbc connections:
    - Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
    - Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;

    for ole db connections
    - Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
    - Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;

    for .net connections
    - Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
    - Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;
    - Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
    - Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

    also if you are connecting with an sql server account, please check if you have set authentication mode of sql server to mixed mode.

    and finally if your sql server is on a seperate machine, please be sure that there is no firewall or router is locking the communication of iis and sql server.

    if these won't help you to solve the problem, please give us some details like
    - your connectionstring
    - is your sql server is on another computer
    - configuration details of your sql server (like active net libraries, authentication details)

    giovedì 22 marzo 2007 20:21
  • hi kadir,

    thank-you for the quick reply. i will check all your suggestions and report back.

    in the meantime, sql and webserver are all on the same server and the connection string is:-

    databaseServer = "PROVIDER=SQLOLEDB;DATA;UID=xxx;PWD=xxx;DATABASE=xxx"

    giovedì 22 marzo 2007 21:02
  • hi kadir,

    i must confess i'm not an sql server expert.

    1. latest service pack and mdac were already installed.

    2. allow remote connections is enabled. i couldn't see where (see point 3) using tcp/ip was. i'm using the ms sql management studioto find this information.

    3. using sql server configuration manager i could find the following.

    sql server 2005 network config -  protocols for msqlserver
    shared memory    enabled
    named pipes    disabled
    tcp/ip    enabled
    via    disabled

    sql native client config - client protocols
    shared memory   enabled
    tcp/ip   enabled
    names pipes   enabled
    via   disabled

    4. we are connecting using an sql account. however, i couldn't see the option to allow mixed.  i could only choose between windows authentication and sql server authentication.


    venerdì 23 marzo 2007 03:22
  • ok, just found the sql server surface area configuration. will check and report back.
    venerdì 23 marzo 2007 03:34
  • remote connections is set to "local and remote connections" and using tcp/ip only.
    venerdì 23 marzo 2007 03:48
  • sql server and windows authentication mode were selected. so it looks like everything was configured they way you wanted.
    venerdì 23 marzo 2007 04:15
  • Hi peter, sorry for the delay,

    sql server and iis is on same machine so can you please test the following connectionstrings:

    and please inform me about the result.

    sabato 24 marzo 2007 19:46
  • Hi

    I m having MS-SQL Server 2005 x64 I ma getting proble with thst as bellow


    Error Number = -2147467259
    Error Message=[DBNETLIB][ConnectionOpen(PreLoginHandshake()).]General network error. Check your network documentation.




    After continuing this message another on is open that is..


    Run-Time error '3709'
    The connection cannot be use to perform this opration. It is either closed or invalid in this context.


    Please let me know the solution for the same..





    Ganesh Deshmukh.


    venerdì 30 maggio 2008 11:23
  • Hi Ganesh,


    Please provide the connection string you are using in the application to connect to SQL Server 2005 x64.


    It looks like you are using MDAC based on the error message you posted [DBNETLIB].

    It is highly recommended to use SQL Native Client that comes with SQL Server 2005 to leverage the full richness of SQL Server 2005.  You can also download SQL Native Client at


    SQL Native Client also provides better connectivity error messages, which may help you diagnose the problem.




    venerdì 30 maggio 2008 23:13

    Hi Jimmy


    Thanks for u r reply. I go through u r  suggestion  and let u know what happns .......





    Ganesh Deshmukh



    lunedì 2 giugno 2008 13:23
  • Hi,
    I was get same error today. If you turn off Firewall of the server the problem will be solved.
    giovedì 11 giugno 2009 07:17
  • Hi, I have the same here (Win2003,IIS6 and SQL2000 and my application had run for 5 years), but I don't update to SQL2005, just change my server and I'm still getting the: 

    Microsoft OLE DB Provider for SQL Server error '80004005'

    [DBNETLIB][ConnectionOpen (PreLoginHandshake()).]General network error. Check your network documentation.


    please help!

    lunedì 5 luglio 2010 19:14
  • Hi,

    I've just struggled with this problem for a (now) virtualised database - Kadir Sümerkent's solution at the top of the thread to allow remote access TCP/IP only fixed my problem.  Thanks.


    lunedì 19 luglio 2010 09:56