How to connect to MSSQL 2000 from PHP 5.3 and up - sql-server-2000

I have a legacy business application built on MS SQL Server 2000. I have some webbased utilities that access this database using PHP 5.2 with mssql extension.
I need to reinstall the web server, and I looked forward to upgrade to PHP 5.4. Unfortunately, the mssql extension is not supported on PHP 5.3 and newer. There is the sqlsrv extension available form Microsoft, but the description says that it is only supported for accessing SQL server 2005 and up.
How can I connect to my SQL Server 2000 from PHP 5.4 ? Did anyone already solve this issue ?

This is a really complicated issue. Here are the details of (in)compatibilities so someone else might spend less time searching and trying.
PHP extension sqlsrv from Microsoft
sqlsrv exists in two (+ an unofficial) versions, they are only compatible with 32-bit PHP. There is currently no version for 64-bit PHP.
sqlsrv version 2.0 is compatible with PHP 5.2.4 to 5.3.x and SQL Native client 2008 R2 to connect to Microsoft SQL Server 2000, 2005, or 2008.
sqlsrv version 3.0 is compatible with PHP 5.3.0 to 5.4.x and SQL Native client 2012 to connect to Microsoft SQL Server 2005, 2008, 2008 R2, and SQL Server 2012.
no official version currently supports PHP 5.5
There is an unofficial version of SQLSRV 3.0 on Rob's Area that does not require SQL Native client 2012 but should run with previous SQL Native clients. I didn't yet try this one.
ODBC extension of PHP
An other way to access SQL Server 2000 with PHP 5.4 is through the odbc extension. It is possible to connect using three ODBC drivers for SQL Server 2000:
SQL Server ODBC client version 6.00 that comes preinstalled with Windows 2008 R2
SQL Server Native Client 9.0 (SQL Server 2005 feature pack)
SQL Server Native Client 10.0 (SQL Server 2008 R2 feature pack)
The code for the connection for each of those ODBC Drivers:
$connection_string = 'DRIVER={SQL Server};SERVER=mbsql;DATABASE=vg1';
$connection_string = 'DRIVER={SQL Native Client};SERVER=mbsql;DATABASE=vg1';
$connection_string = 'DRIVER={SQL Server Native Client 10.0};SERVER=mbsql;DATABASE=vg1';
$connection = odbc_connect( $connection_string, $user, $pass );
These connections work with PHP 32 bit and 64 bit. I din't yet test which one is the best.

Related

Converting SQL Server database to SQL Server Compact edition file (.sdf) version 3.0

I'm currently creating a solution for a software that were developed in 2005 and beside using some more modern technologies, the company wants to keep supports of the old windows embedded compact edition based phones until they can replace everything.
I tried using ErikEJ's Export2SQLCE and SqlCEcmd command tools and thought I found the solution, until I realised the older application is using SQL Server CE version 3.0, whereas ErikEJ's can only convert to 3.5 or 4.
Is there any way to convert an existing SQL Server table into SQL Server CE version 3.0?
If not, is there any way to connect into a SQL Server CE file (.sdf) from a nodejs server and send queries?
Thanks!

Can I Install and use OLE DB for DB2 provider V 4.0 version 9.0.1356.0 on a Client Machine without installing Microsoft SQL Server 2012 or 2008 R2

I develop a VB.Net application who use OLE DB Provider for DB2 to get and send data from/to distance DB2 database.
Do I have install SQL Server 2012 or 2008 R2 and OLE DB Provider for DB2 for each client machine for an executable application VB.Net. Is there any solution to avoid SQL Server 2008R2 or 2012 installation when I install the provider?
If not what is the necessary feature of SQL Server 2012 or 2008R2 to install and use DB2 V 4.0 version 9.0.1356.0?
Why not use the OLEDB provider from IBM?
You don't say what platform and version of DB2, that will make a difference in where you find the appropriate driver from IBM.

There was an unknown error applying the filestream settings. check the parameters are valid

I am getting the following error while trying to configure FileStream in SQL server 2012.
There was an unknown error applying the filestream settings. check the parameters are valid. (0x80041008)
I am configuring it using SQL server configuration manager.
Where as I am able to setup it for SQL server 2008 R2.
I had this same problem just yesterday.
In my case it was because I had a 64-bit Windows and a 32-Bit SQL Server.
You do not see the exact error, but if you try to do it with T-SQL, then the proper error comes up in SQL, telling you something about "WOW64" not supporting filestream.
I just uninstalled and installed the right bit version of SQL, and all worked 100% again.
In my case the problem I was running the SQL Server 2014 configuration manager. While this usually shouldn't cause problems, in my case it did. Configuring FILESTREAM using the SQL Server 2012 configuration manager worked.
If it still doesn't work, make sure you're up-to-date. SQL Server 2012 has received quite a lot of patches (SP2, SP3, and some updates).
TL;DR
I simply installed Service pack 2 (SP2) patch of SQL Server 2008 R2 and everything started working for me.
Read on if you want to know more. Configuration wise my box was all correct and the file stream feature should have been working on my default instance of SQL Server 2008 R2. Here are my box details:
Operating System: Windows 7 Ultitmate SP1 (64 Bit)
SQL Server Version: SQL Server 2008 R2 SP1
On SQL Server if I run this query select ##version it was returning following details:
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010 15:48:46 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
Whenever I opened SQL Server 2008 Configuration manager I will face this issue. Luckily I also had SQL Server 2014 installed on my machine. So I tried enabling File Stream feature from configuration manager GUI of SQL Server 2014 but it started giving error mentioned in current post.
I simply installed Service pack 2 (SP2) patch of SQL Server 2008 R2 and everything started working for me. SQL Server Configuration manager for 2008 R2 also works fine and I'm able to enable File Stream feature also without any trouble. SQL Server 2008 R2 SP2 can be downloaded from here.

SQL Native Client & OLEDB

We have a Windows 2008 server with SQL Server 2005 SP3 with a bunch of classic ASP sites that are using SQLOLEDB to connect.
We have a new application that requires SQL Server Native Client 2008 R2 installed because it is using the SQLSRV PHP Driver. SQL Server Native Client 2005 is already installed (as part of SQL Server install).
Are there any issues with installing SQL Server Native Client 2008 R2 and connecting using SQLOLEDB? I'm assuming that 2008 client is backward compatible with the 2005 client?
Can the 2008 client be uninstalled back to 2005 if we need to roll-back?
I'm concerned that installing this could cause issues for the sites already using OLEDB.
Any help or insight is greatly appreciated.
Thanks
Dave
You can install them side by side no problem.
Are there any issues with installing SQL Native Client 2008 R2 and
connecting using SQLOLEDB?
No (apart from the lower functionality set of SQLOLEDB)
I'm assuming that 2008 client is backward compatible with the 2005
client?
Yes.
Can the 2008 client be uninstalled back to 2005 if we need to
roll-back
Yes

Is it possible to install SQL Server 2005 (enterprise edition) on Windows Server 2008?

Is it possible to install SQL Server 2005 (Enterprise Edition) on Windows Server 2008?
Sure, why shouldn't it be possible to do that???
Just do it! I don't see any reasons why you should have any issues with this setup.
Go ahead and try it - if you run into any actual problems, come back (but preferably to http://Serverfault.com) and ask for help.
Yes. The SQL Server version doesn't have to match the operating system version, as it is for example with the IIS.
Yes.
What does the MS site for SQL Server 2005 say? (my bold)
SQL Server 2005 on Windows Server 2008
and Windows Vista
In an effort to provide customers with
more secure products, Microsoft
Windows Server 2008 and Microsoft
Windows Vista are supported by SQL
Server 2005 Express Edition Service
Pack 1 (SP1), and for all other
editions will be supported by SQL
Server 2005 Service Pack 2 (SP2) or
later when it becomes available.
Earlier versions of SQL Server,
including SQL Server 2000 (all
editions including Desktop Engine
edition, a.k.a MSDE), SQL Server 7.0,
and SQL Server 6.5, will not be
supported on Windows Server 2008 or
Windows Vista.