我在读数据库的时候发现该数据库的一个字段的数据类型是OLE对象。现在我需要将该字段的数据读出来,请问哪个大虾帮忙告诉我该怎么办!!!!
谢谢!!!!!!

解决方案 »

  1.   

    rs("data").GetChunk
    GetChunk Method - ADO
    Returns all or a portion of the contents of a large text or binary data Field object. Applies To Field Syntax variable = field.GetChunk( Size ) Return Values Returns a Variant. Parameters Size A Long expression equal to the number of bytes or characters you want to retrieve. Res Use the GetChunk method on a Field object to retrieve part or all of its long binary or character data. In situations where system memory is limited, you can use the GetChunk method to manipulate long values in portions rather than in their entirety. The data a GetChunk call returns is assigned to variable. If Size is greater than the remaining data, the GetChunk method returns only the remaining data without padding variable with empty spaces. If the field is empty, the GetChunk method returns Null. Each subsequent GetChunk call retrieves data starting from where the previous GetChunk call left off. However, if you are retrieving data from one field and then you set or read the value of another field in the current record, ADO assumes you are done retrieving data from the first field. If you call the GetChunk method on the first field again, ADO interprets the call as a new GetChunk operation and starts reading from the beginning of the data. Accessing fields in other Recordset objects (that are not clones of the first Recordset object) will not disrupt GetChunk operations. If the adFldLong bit in the Attributes property of a Field object is set to true, you can use the GetChunk method for that field. If there is no current record when you use the GetChunk method on a Field object, error 3021 (no current record) occurs. 
      

  2.   

    这位大哥 ,你发的是什么啊 ,小弟英语不好 没看懂,我现在用VB在写代码,麻烦你用VB写代码或者用中文写写解决办法好吗?  谢谢!!!!
      

  3.   

    读出的变量 = rs("字段").GetChunk(字段大小)
      

  4.   

    dim aa as object
      set aa =rs("字段").getchunk(字段大小)
      是这样的吗?
       字段大小怎么确定?  在数据库中看该字段是OLE对象。怎么看大小?
      

  5.   

    我试验了,但是读出来的全是乱码。你知道这是什么原因吗?还有这个字段的类别是ole对象。
    const VarSize=100
    dim varLongSize as long
    varLongSize=rs("字段").actualsize
    do while LngSize<varLongSize
       varChunk=rs("字段").getchunk(varsize)
       varLogo=varlogo & varChunk
       varLogo=varLogo + varSize
    loop
      

  6.   

    我按你的方法做了 ,但是我读取后 发现东西全是乱码.不知道为什么.还有  我并不知道改ole对象是什么,只知道是长二进制数据.
    我的这种情况怎么搞??