ADODB.Stream 取不到值,不知道为什么?
Dim iStm As ADODB.StreamDim iRe As ADODB.Recordset
Dim iConcstr As String
'读取文件到内容
Set iStm = New ADODB.Stream
With iStm
.Type = adTypeText '二进制模式
.Open
MsgBox List2.List(List2.ListIndex)
.WriteText "12345678"
End With
'打开保存文件的表
Set iRe = New ADODB.Recordset
With iRe
.Open "select * from VEGA_WCM_CONTENT", conn, 1, 3
.AddNew '新增一条记录
.Fields("CONTENT_ID") = "1"
MsgBox iStm.EOS
MsgBox iStm.State
MsgBox iStm.ReadText '这里显示是空
.Fields("CONTENT_PROPERTY") = iStm.ReadText
.Update
End With --------------------编程问答-------------------- 通过Position=0定位到文件流头部,再进行ReadText,否则就是在EOS的状态下进行读取。
补充:VB , 基础类