I used php-odbtp for the PHP interface (with ADOdb ) to the MS SQL server, and it works well, even on remote networks.
It provides a tunneling protocol from a non-odbc (Linux) platform to a service installed on a Win32 machine to buffer requests to and from an ODBC connection. A bit of pain to set up the first time, at least 2-3 years ago when I first used it. Should also work just fine for Win32 ↔ Win32 applications.
Not familiar with SQL CE, but I would suggest that it supports some kind of ODBC connection and standard T-SQL commands.
source share