Respondida Connection Error

  • martes, 13 de marzo de 2012 20:56
     
     

    Hi;

    I'm running SQL Server 2005 Express Edition on a Windows 7 64bit system. My databases are set and running. The problem is when I try to access my database through PHP; I get an odd error;

    "Connection could not be established.
    Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code] => -49 [2] => This extension requires the Microsoft SQL Server 2011 Native Client. Access the following URL to download the Microsoft SQL Server 2011 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension requires the Microsoft SQL Server 2011 Native Client. Access the following URL to download the Microsoft SQL Server 2011 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] => Array ( [0] => IM002 [SQLSTATE] => IM002 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ) )"

    I have sqlsrv installed on Wamp 2.2d. What is causing this and how can I resolve it?

    Thanks.

    • Editado Pesokow martes, 13 de marzo de 2012 20:59
    •  

Todas las respuestas

  • miércoles, 14 de marzo de 2012 10:41
     
     Respondida

    As you probably know, the driver says you need to install the SQL Server Native Client 2011 edition.

    There is something wrong here - the main thing that's wrong is that Microsoft keep naming products with years in them, with version numbers that don't match.  Aaarrgghh!

    Are you using the brand new version 3.0 PHP driver?  The error message is wrong in the source code, it should read that you need the Native Client for 2012.

    If you do have version 3.0 of the driver, this answer is right.  If you are using version 2.0, you can probably figure out what changes to make, the essence is the same:

    The error message also says you need the x86 version - but I think that's also wrong...  the Native Client version must match the computer that is connecting to the SQL Server... what type of computer is PHP running on?

    If you're running PHP on a 64 bit system, you need these:

    • Wamp 2.2d - 32 bit version
    • SQL Server Native Client 2012 64 bit version (the 32 bit version will *not* install)

    If you're running PHP on a 32 bit system you need:

    • Wamp 2.2d - 32 bit version
    • SQL Server Native Client 2012 32 bit version

    Native Client 2012 downloads are here: http://www.microsoft.com/download/en/details.aspx?id=29065

    Search the page for "Microsoft® SQL Server® 2012 Native Client"


    Rob

  • jueves, 15 de marzo de 2012 18:16
     
     

    I've file a bug for the incorrect error name. However, the link that comes up in the error message is correct and directs you to the necessary setup instructions...?

    Thanks,

    Jonathan


    This posting is provided 'AS IS' with no warranties, and confers no rights.

  • jueves, 15 de marzo de 2012 19:01
     
     

    Everyone in the world gets confused.

    Except for: Visual C++ 10 = Visual Studio 2010 - easy to remember!

    But SQL Server 2012 = Native Client 11.0 ? That's no good.  You mixed them up and wrote 2011 in your own driver!

    I suggest you at Microsoft copy Eclipse, and name your 'versions' with actual names and not numbers; they use galaxies, you could choose your own theme... 

    The link "http://go.microsoft.com/fwlink/?LinkId=163712" takes you to a page with information about the 3.0 driver, but it the top the heading is still "SQL Server 2008 R2"

    Thanks Jonathan :)


    Rob

  • lunes, 19 de marzo de 2012 20:40
     
     

    Everyone in the world gets confused.

    Except for: Visual C++ 10 = Visual Studio 2010 - easy to remember!

    But SQL Server 2012 = Native Client 11.0 ? That's no good.  You mixed them up and wrote 2011 in your own driver!

    I suggest you at Microsoft copy Eclipse, and name your 'versions' with actual names and not numbers; they use galaxies, you could choose your own theme... 

    The link "http://go.microsoft.com/fwlink/?LinkId=163712" takes you to a page with information about the 3.0 driver, but it the top the heading is still "SQL Server 2008 R2"

    Thanks Jonathan :)


    Rob

    Rob,

    Thanks for the feedback - we are actively working on our versioning story for our drivers and I hope that our new scheme makes more sense for you. :) We've also fixed the error bug in our upcoming 5.4 build. Finally, David is working to figure out the problems with our documentation.

    Thanks!

    Jonathan


    This posting is provided 'AS IS' with no warranties, and confers no rights.