0

I'm trying to connect my laravel to SQL Server and it show the error below

SQLSTATE[08001]: [Microsoft][ODBC Driver 11 for SQL Server]ODBC Driver 11 for SQL Server does not support connections to SQL Server 2000 or earlier versions.

I'm using php 7.3 and I already download the dll for 7.3.

How can I solve this?

Dale K
  • 25,246
  • 15
  • 42
  • 71
Jovs
  • 852
  • 7
  • 23
  • im just using regular odbc not a native one. and there's no accepted answer on that question – Jovs Nov 06 '19 at 03:30
  • The error tells you what you need to know though, the driver doesn't support SQL Server 2000. When you google for a SQL Server 2000 ODBC driver what do you get? – Dale K Nov 06 '19 at 03:34
  • i dont see any lower version than 11. – Jovs Nov 06 '19 at 03:36
  • Does this help https://laracasts.com/discuss/channels/eloquent/eloquent-and-server-2000 – Dale K Nov 06 '19 at 03:39
  • Sadly but nope. I need to connect to a multiple SQL Server so that doesn't work for me. – Jovs Nov 06 '19 at 06:01
  • What are your `Laravel` connection settings (which driver do you set to connect to SQL Server)? – Zhorov Nov 06 '19 at 06:49
  • I'm using PDO in controller. so everytime I need to connect to sql server then I will call it using PDO then like this `new PDO ("sqlsrv:Server=localhost;Database=test", "sa", "");` – Jovs Nov 06 '19 at 06:52
  • @Jovs Based on [Support Matrix](https://learn.microsoft.com/en-us/sql/connect/php/microsoft-php-drivers-for-sql-server-support-matrix?view=sql-server-ver15), PHP Driver for SQL Server (`sqlsrv` PHP extension) do not support SQL Server 2000. It's strange, but `Laravel` do not support `mssql` extension, so the only possible option should be `odbc`. – Zhorov Nov 06 '19 at 07:05
  • @Jovs This [answer](https://stackoverflow.com/questions/19783613/how-to-connect-to-mssql-2000-from-php-5-3-and-up/19787528) may help to find an alternative solution. – Zhorov Nov 06 '19 at 07:10

0 Answers0