Getting data from SQL

  • Hi all,

    My system built on 3-tier atchitecture with:

    interface: using vb6

    Business rull: Com+ service

    Data Store: SQL 2000

    When i get data from server to workstation, i used adodb.recordset and adodb.stream to transform that to xml and transport this xml string from server to client.

    the proplem that, my customer leased line is quite slow(<=64k) and xml string is quite hard( may be 200 kb).

    any idea or solution for this problem to improve performace and network round strip.

     

    thanks for reading this

     

  • This was removed by the editor as SPAM

  • Just a thought, why cannt you put all your transformation logic in a stored procedure and return xml string, so that it can minimize round trip






    Regards,
    Sudheer 

    My Blog

  • Thanks for your advice,

    That problem i have to face is occured when workstation need some data from database, such as common list or saved data...

    Currently i put all my business logic in server component using window component service ( application server) and my database server is near by it. So, the problem you have mentioned is not important for us.

    I am wondering that are there any solution for splitting data package when transport that xml string from server to client

    Thanks anyway!!

     

  • Isn't there anyway to just return the recordset without transforming to xml?

    Xml is only a much more bloated version of the data and therefore takes more resources to transport.

  • Hi,

    I got my own solution now. all that i need is an string compression function in Vb6. I think it can solve my serious trouble.

    Do you know where can i get that function ( vb6 source code)????

    thanks and have a nice day!

     

     

  • Hi first did you try marshalling and queues ??? why don't you ...

     

     

    any way compression is down

     

    Public Function Compress(StringIn As String, _                Optional Blocksize As Long) As String        Dim T As Long    Dim I As Long    Dim J As Long    Dim Blocklength As Long    Dim Point As String    Dim CompressedStr As String        On Error GoTo ErrHandler:        ' Make sure the variables have their    ' startup values...    If Blocksize = 0 Then Blocksize = 1    Point = Left(StringIn, Blocksize)    CompressedStr = Blocksize & Chr(128)    I = 0        'Do the real work here...    For T = 1 To Len(StringIn) Step Blocksize            I = I + Blocksize        If Mid(StringIn, T, Blocksize) <> Point Then                      CompressedStr = CompressedStr & Point & _                        (I - Blocksize) / Blocksize & _                        Chr(128)                      I = Blocksize           Point = Mid(StringIn, T, Blocksize)                   End If               Next T        ' Catch the last one that the loop misses...    CompressedStr = CompressedStr & Point & _        I / Blocksize & Chr(128)            Compress = CompressedStr        Exit Function    ErrHandler:        Compress = ""    End FunctionPublic Function UNcompress(ByVal StringIn As String) As String        Dim T As Long    Dim I As Long    Dim J As Long    Dim M As Long    Dim Parts() As String    Dim Block As String    Dim Length As String    Dim Blocklength As Long    Dim UNCompressedStr As String        I = 0        On Error GoTo ErrHandler:        ' get the blocksize    For T = 1 To Len(StringIn)                If Mid(StringIn, T, 1) = Chr(128) Then            Blocklength = Left(StringIn, T - 1)            StringIn = Right(StringIn, Len(StringIn) - T)            T = Len(StringIn)        End If            Next T        ' discover how many parts we have...    For T = 1 To Len(StringIn)            If Mid(StringIn, T, 1) = Chr(128) Then J = J + 1            Next T        ' create I variables to hold the parts of StringIn    ReDim Parts(J + 1)        ' Break Stringin into it's parts...    For T = 1 To J + 1                For I = 1 To Len(StringIn)                        If Mid(StringIn, I, 1) = Chr(128) Then                                Parts(T) = Left(StringIn, I - 1)                StringIn = Right(StringIn, Len(StringIn) - I)                I = Len(StringIn)                            End If                    Next I            Next T        ' Build the uncompressed string...    For T = 1 To J                Block = Left(Parts(T), Blocklength)        Length = Right(Parts(T), Len(Parts(T)) - Blocklength)        I = Int(Length)                For M = 1 To I                        UNCompressedStr = UNCompressedStr & Block                    Next M            Next T        UNcompress = UNCompressedStr        Exit Function    ErrHandler:        UNcompress = ""End Function

    Hold on hold on soldier
    When you add it all up
    The tears and marrowbone
    There's an ounce of gold
    And an ounce of pride in each ledger
    And the Germans killed the Jews
    And the Jews killed the Arabs
    And Arabs killed the hostages
    And that is the news
    And is it any wonder
    That the monkey's confused

  • Hi first did you try marshalling and queues ??? why don't you ...

     

     

    any way compression is down

     

    Public Function Compress(StringIn As String, _                Optional Blocksize As Long) As String        Dim T As Long    Dim I As Long    Dim J As Long    Dim Blocklength As Long    Dim Point As String    Dim CompressedStr As String        On Error GoTo ErrHandler:        ' Make sure the variables have their    ' startup values...    If Blocksize = 0 Then Blocksize = 1    Point = Left(StringIn, Blocksize)    CompressedStr = Blocksize & Chr(128)    I = 0        'Do the real work here...    For T = 1 To Len(StringIn) Step Blocksize            I = I + Blocksize        If Mid(StringIn, T, Blocksize) <> Point Then                      CompressedStr = CompressedStr & Point & _                        (I - Blocksize) / Blocksize & _                        Chr(128)                      I = Blocksize           Point = Mid(StringIn, T, Blocksize)                   End If               Next T        ' Catch the last one that the loop misses...    CompressedStr = CompressedStr & Point & _        I / Blocksize & Chr(128)            Compress = CompressedStr        Exit Function    ErrHandler:        Compress = ""    End FunctionPublic Function UNcompress(ByVal StringIn As String) As String        Dim T As Long    Dim I As Long    Dim J As Long    Dim M As Long    Dim Parts() As String    Dim Block As String    Dim Length As String    Dim Blocklength As Long    Dim UNCompressedStr As String        I = 0        On Error GoTo ErrHandler:        ' get the blocksize    For T = 1 To Len(StringIn)                If Mid(StringIn, T, 1) = Chr(128) Then            Blocklength = Left(StringIn, T - 1)            StringIn = Right(StringIn, Len(StringIn) - T)            T = Len(StringIn)        End If            Next T        ' discover how many parts we have...    For T = 1 To Len(StringIn)            If Mid(StringIn, T, 1) = Chr(128) Then J = J + 1            Next T        ' create I variables to hold the parts of StringIn    ReDim Parts(J + 1)        ' Break Stringin into it's parts...    For T = 1 To J + 1                For I = 1 To Len(StringIn)                        If Mid(StringIn, I, 1) = Chr(128) Then                                Parts(T) = Left(StringIn, I - 1)                StringIn = Right(StringIn, Len(StringIn) - I)                I = Len(StringIn)                            End If                    Next I            Next T        ' Build the uncompressed string...    For T = 1 To J                Block = Left(Parts(T), Blocklength)        Length = Right(Parts(T), Len(Parts(T)) - Blocklength)        I = Int(Length)                For M = 1 To I                        UNCompressedStr = UNCompressedStr & Block                    Next M            Next T        UNcompress = UNCompressedStr        Exit Function    ErrHandler:        UNcompress = ""End Function

    Hold on hold on soldier
    When you add it all up
    The tears and marrowbone
    There's an ounce of gold
    And an ounce of pride in each ledger
    And the Germans killed the Jews
    And the Jews killed the Arabs
    And Arabs killed the hostages
    And that is the news
    And is it any wonder
    That the monkey's confused

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply