服务端将记录集转化为二进制发送
Public Function RecordsetToBimary(rs As Recordset) As Byte()
Dim stm As Stream
Set stm = New Stream
stm.Open
stm.Type = adTypeBinary
rs.Save stm, adPersistADTG
stm.Position = 0
RecordsetToBimary = stm.Read()
Set stm = Nothing
End Function
'客户Duan将二进制转化为记录集
Private Function BimaryToRecordset(vData() As Byte) As Recordset
Dim stm As Stream
Dim rs As Recordset
Set stm = New Stream
stm.Open
stm.Type = adTypeBinary
stm.Write vData
stm.Position = 0
Set rs = New Recordset
rs.Open stm
Set BimaryToRecordset = rs
Set rs = Nothing
Set stm = Nothing