使用ADO的MS SQL 6.5 INSERT中的高阶ASCII字符 [英] High Order ASCII chars in MS SQL 6.5 INSERT using ADO
问题描述
我已经搜索了所有内容,但找不到答案。
我有一条类似于
$的SQL语句b $ b
插入myTable值('Value1','Value2','Value3²More','Value4√EvenMore')
其中,平方字符(在3和More之间)为0xFD,平方根符号(在4和Even之间)为0xFB。 / p>
这是从ADO进入MSSQL 6.5数据库的。我尝试使用\xFE,\0xFE甚至使用八进制(\o375)来转义字符,但我不知道如何执行此操作。
基本上,这些字符是基于Pick的系统使用的定界符@VM和@TM。如果我直接传递字符,它们将转换为?。
我们在ado连接字符串中具有AutoTranslate = 0。
任何帮助将不胜感激。我不是SQL专家,所以请保持冷静。
Aaron
在妻子的一点帮助下,我解决了问题。
原来我需要使用CHAR来连接值
so ..
插入myTable VALUES('Value1','Value2','Value 3'+ CHAR(253)+'More','Value 4'+ CHAR(251)+'Even More')
你们都知道,我应该知道。
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
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.
这篇关于使用ADO的MS SQL 6.5 INSERT中的高阶ASCII字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!