Private Sub CmdSave_Click() Dim pByte() As ByteDim str As String Dim iStrm As ADODB.Stream ComB1.FileName = "" ComB1.Filter = "*.txt|*.txt" '前面一个表示显示的滤波,后面一个表示存文件的滤波 ComB1.DialogTitle = "保存移动测试数据文件" ComB1.ShowSave ComB1.FileName = App.Path + "/Move.txt" If ComB1.FileName = "" Then Exit Sub End If Set iStrm = New ADODB.Stream With iStrm .Type = adTypeBinary .Open .LoadFromFile ComB1.FileName End With
Adodc1.RecordSource = "select * from MOVE_TXT where EMETest_id=36" Adodc1.Refresh
Debug.Print pByte End Sub 字段是image,varbinary,ntext,都没有办法执行,说istream.Read为NULL,但是在这句DEBUG下来,执行前里面有值,但是执行错误后里面的值为NULL了,不知道是什么原因.还有在用Stream之前我用的是二进制文件读成pByte,然后放进去也不行.
strTmp = StrConv(arr, vbUnicode)
怎样将该unicode格式的数据存取到数据库当中??
用UNICODE转换就变成了F8 00,请问有什么办法可以不失真??
byte()无法直接存储到该字段当中,但是若把它转换成为String,就失真了,还有用StrConv也失真了,我就没有办法了,
我觉得这是一类大的问题.希望大家来讨论,谢谢.
Dim pByte() As ByteDim str As String
Dim iStrm As ADODB.Stream
ComB1.FileName = ""
ComB1.Filter = "*.txt|*.txt" '前面一个表示显示的滤波,后面一个表示存文件的滤波
ComB1.DialogTitle = "保存移动测试数据文件"
ComB1.ShowSave
ComB1.FileName = App.Path + "/Move.txt"
If ComB1.FileName = "" Then
Exit Sub
End If Set iStrm = New ADODB.Stream
With iStrm
.Type = adTypeBinary
.Open
.LoadFromFile ComB1.FileName
End With
Adodc1.RecordSource = "select * from MOVE_TXT where EMETest_id=36"
Adodc1.Refresh
Adodc1.Recordset("MOVE_file") = iStrm.Read
Adodc1.Recordset.Update
Debug.Print pByte
End Sub
字段是image,varbinary,ntext,都没有办法执行,说istream.Read为NULL,但是在这句DEBUG下来,执行前里面有值,但是执行错误后里面的值为NULL了,不知道是什么原因.还有在用Stream之前我用的是二进制文件读成pByte,然后放进去也不行.