Professional Web Applications Themes

Storing compressed string - Microsoft SQL / MS SQL Server

Hi, folks! In my application I am compressing a large string using zlib (in VB6), and want to store this in a MSSQL2000 database. When storing this compressed string in a field with the datatype "text", some of the bytes "disappear", probably because of escape-characters or something like that... (?) The length of the string i inserted is a few bytes longer than the length of the string i selected afterwards. I am using stored procedures to insert into and select data from the database. Have anyone experienced problems like this before? If this happens because of escape-characters, which characters ...

  1. #1

    Default Storing compressed string

    Hi, folks!

    In my application I am compressing a large string using zlib (in VB6),
    and want to store this in a MSSQL2000 database. When storing this
    compressed string in a field with the datatype "text", some of the
    bytes "disappear", probably because of escape-characters or something
    like that... (?) The length of the string i inserted is a few bytes
    longer than the length of the string i selected afterwards.

    I am using stored procedures to insert into and select data from the
    database.

    Have anyone experienced problems like this before?

    If this happens because of escape-characters, which characters must
    "be taken care of"?

    Should I rather use a binary datatype, such as "Image"?

    I'm using VB6 and MSSQL 2000 sp3.

    TIA!

    --
    Erik Ommundsen
    Erik Ommundsen Guest

  2. #2

    Default Re: Storing compressed string

    Could you show your stored procedure, as well as the actual call you make
    (including the 'compressed' string) to reproduce this problem?

    Also, is SQL Server 2000 at SP3?

    --
    Aaron Bertrand, SQL Server MVP
    [url]http://www.aspfaq.com/[/url]

    Please reply in the newsgroups, but if you absolutely
    must reply via e-mail, please take out the TRASH.


    "Erik Ommundsen" <eommundsstud.hia.no> wrote in message
    news:be0fc65f.0307010340.6fa17d03posting.google.c om...
    > Hi, folks!
    >
    > In my application I am compressing a large string using zlib (in VB6),
    > and want to store this in a MSSQL2000 database. When storing this
    > compressed string in a field with the datatype "text", some of the
    > bytes "disappear", probably because of escape-characters or something
    > like that... (?) The length of the string i inserted is a few bytes
    > longer than the length of the string i selected afterwards.
    >
    > I am using stored procedures to insert into and select data from the
    > database.
    >
    > Have anyone experienced problems like this before?
    >
    > If this happens because of escape-characters, which characters must
    > "be taken care of"?
    >
    > Should I rather use a binary datatype, such as "Image"?
    >
    > I'm using VB6 and MSSQL 2000 sp3.
    >
    > TIA!
    >
    > --
    > Erik Ommundsen

    Aaron Bertrand [MVP] Guest

Similar Threads

  1. huh can`t send compressed string ??????? with webservice
    By M. Posseth in forum ASP.NET Web Services
    Replies: 1
    Last Post: April 3rd, 04:42 PM
  2. PHP Storing compressed data in mssql image field
    By Marcel in forum PHP Development
    Replies: 2
    Last Post: December 11th, 09:38 AM
  3. Replies: 0
    Last Post: August 9th, 07:46 PM
  4. [PHP] Storing HTML string in database
    By Jacob C in forum PHP Development
    Replies: 1
    Last Post: July 11th, 01:29 AM
  5. Storing HTML string in database
    By Aaron Axelsen in forum PHP Development
    Replies: 0
    Last Post: July 11th, 01:13 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139