array of UDT and a stream

From: Ward (king.albert.II_at_for.president.com)
Date: 07/23/04


Date: Fri, 23 Jul 2004 14:22:48 GMT

I have a problem writing an array UDT to a stream.
The array UDT is properly defined.
  
            Option Explicit
            Public Type my_records
        idkamion As String * 4
        depot As String * 45
        tiepe As String * 30
            End Type
            ....
Then in the main section:
            Dim my_record(1 To 10000) As my_records
            ...

When I put this in a loop, it debug.prints just fine :

            my_record(i).idkamion = rst.Fields("idkamion")
            my_record(i).depot = rst.Fields("depot")
            my_record(i).tiepe = rst.Fields("type")

However if I try to WriteText the UDT to the stream
VB6 exits saying "Operation not allowed in this context", but
all members of the UDT are strings so what's the problem ?

Do Until i = limiet
            With my_record(i)
               stm.WriteText .idkamion
           stm.WriteText .depot
           stm.WriteText .tiepe
           i = i + 1
     End With
Loop

  
thx

Ward