Results 1 to 5 of 5

Thread: Sending recordset over Winsock

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    2

    Sending recordset over Winsock

    Hi,

    I am working with VB Client/Server application with winsock control. I want to pass recordset (100 records) from server to client. Let me know how to pass those records and group it in client and assign it to data grid.

    Thanks in advance.

  2. #2
    Lively Member
    Join Date
    Jan 2009
    Posts
    90

    Re: Sending recordset over Winsock

    .

    (Misunderstood question)
    Last edited by Daniel Elkins; Jan 9th, 2009 at 09:29 AM.

  3. #3
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Sending recordset over Winsock

    Use the recordset.GetRows function to copy the data into a Variant

    Add that Variant data to a PropertyBag, then copy the data from PropertyBag.Contents to a byte array.

    Sent the byte array through winsock

    When you want to read the data, you have to get the byte array, them copy it into a PropertyBag using the Contents property. Then read the Variant data.

    Once you have the data into a Variant, then display it by looping through the double array (the rows & columns of the recordset)

  4. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Sending recordset over Winsock

    The standard approach is to do Recordset.Save into an ADO Stream object. Then you can use Stream.Read to retrieve the PersistFormat data bytes of the Recordset into a Byte array.

    At the other end put this PersistFormat data back via Stream.Write and then Recordset.Open against the Stream.

    You have two choices for the PersistFormat: binary ADTG and UTF-8 text XML.

  5. #5
    New Member
    Join Date
    Nov 2011
    Posts
    2

    Re: Sending recordset over Winsock

    hello, can you post some code example plz?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width