Is this the way to prevent (all) Microsoft SQL Server injections if you want to use ODBC?
public function mssql_escape($str)
{
if (get_magic_quotes_gpc()):
$str = stripslashes($str);
endif;
return str_replace("'", "''", $str);
}