High Order ASCII chars in MS SQL 6.5 INSERT using ADO

ⅰ亾dé卋堺 提交于 2019-12-25 03:12:52

问题


I've searched all about and can't find an answer to this.

I have an SQL statement similar to

insert myTable VALUES ( 'Value1', 'Value2', 'Value 3²More', 'Value 4√Even More' )

where the square char (between the 3 and the More) is 0xFD and the square root sign (between the 4 and the Even) is 0xFB.

This is going from ADO into an MSSQL 6.5 database. I've tried escaping the chars such using \xFE, \0xFE, even using octal (\o375) but I have no idea how to do this.

Basically, these chars are delimiters @VM and @TM used by Pick based systems. If I pass the characters in directly, they get converted to ?.

We have AutoTranslate=0 in the ado connection string.

Any help would be appreciated. I'm not an SQL guy so please be gentle.

Aaron


回答1:


I worked it out, with a little help from my wife. Turns out I need to concatenate the values using CHAR

so..

insert myTable VALUES ( 'Value1', 'Value2', 'Value 3' + CHAR(253) + 'More', 'Value 4' + CHAR(251) + 'Even More' )

which you all knew and I should have known.



来源:https://stackoverflow.com/questions/4809982/high-order-ascii-chars-in-ms-sql-6-5-insert-using-ado

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!