开发者

New web server and old SQL Server with different results with same code?

开发者 https://www.devze.com 2023-02-15 11:29 出处:网络
I have a new server with the same Classic ASP code connecting to same SQL Server 2000 database with the same connection string yet it seems to be pulling data out o开发者_StackOverflow社区f the databa

I have a new server with the same Classic ASP code connecting to same SQL Server 2000 database with the same connection string yet it seems to be pulling data out o开发者_StackOverflow社区f the database differently now. Specifically there is a custom encryption function which creates special characters (non-ASCII) and stores them in a VARCHAR field. (This is legacy code.) Since nothing has changed except the web server it has been hard to diagnose this problem.

Is there some setting that would control the database driver which would allow this data to come out of the database? It seems the character set is not treated the same with the new server as it was with the old server. Is there something I can change in the ODBC driver settings?

The server version change is from IIS 6 to IIS 7.5. The new server obviously also has new ODBC driver versions.

Any help is appreciated?


I suspect something to do with Locale rather than anything else. However I don't understand Locale. :-(

If it is a stored proc, a quick-fix might be to change the data type on the DB parameter/column to NVARCHAR. With ASP it will be unicode BSTR values in the application anyway, so moving the conversion into the database may make it easier to control, if necessary by specifying a collation to use for the conversion.

If you have the ASP code you could also edit the select to say cast(password as nvarchar(50)) as password or whatever to achieve the same result.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号