在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。
同样的一个php file,连接到同样的一个远程数据库
$db = new COM("ADODB.Connection",NULL,CP_UTF8);
$dsn = "DRIVER={SQL Server};SERVER=;UID=;PWD=; DATABASE=;autotranslate=no";
$result = new COM("ADODB.RecordSet");
$result->CursorLocation =3;
$a=$_POST["fda"];
$sql="insert into test(test) values(N'$a')";
$result->open($sql,$db);
在我机器上运行的时候提示
Could not convert string to unicode: `在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 '
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft OLE DB Provider for ODBC Drivers<br/><b>Description:</b> [Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation  before the character string '闃?'.' in F:\Localhost\mmm4him\b.php:31 Stack trace: #0 F:\Localhost\mmm4him\b.php(31): com->open('insert into tes...', Object(com)) #1 {main} thrown in但是php文件上传到服务器就一切正常.php.ini也都是完全一样的,是不是有什么问题在IIS上?
windows7+ php5 fast cgi
数据库都是同一个远程服务器上的mssql