ASP returning null sized field from MS SQL database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Grant Davis

    ASP returning null sized field from MS SQL database

    We currently have an SQL db running on a web server.
    One of these fields is a large(ish) amount of text data – up to 400
    characters – and has been cast variously as varchar, nchar and text
    type to overcome a problem. The problem appears to be in retrieving
    the data via ASP. I understand that ASP can handle string data of this
    size so I am okay there.
    When the records are retrieved from the db, the data string length =0.
    I know the data is there because I have written a Delphi data manager
    which interrogates the db and shows all records and their contents.
    So if ASP can handle strings this size and the data is there, why do I
    get a data length of zero bytes returned when I interrogate the record
    set?
    Whichever way I cast this field I get the same result.

    I know the code is sound as it works locally through a MS SQL server
    on my PS.
    Anyone have this problem or know what's causing it? I have logged a
    support call with my hosting company, but they haven't replied as yet
    and I am stuck on an urgent project.

    Any suggestions?

    Cheers
    Grant
  • Erland Sommarskog

    #2
    Re: ASP returning null sized field from MS SQL database

    Grant Davis (grant@gbdavis. com) writes:[color=blue]
    > We currently have an SQL db running on a web server.
    > One of these fields is a large(ish) amount of text data – up to 400
    > characters – and has been cast variously as varchar, nchar and text
    > type to overcome a problem. The problem appears to be in retrieving
    > the data via ASP. I understand that ASP can handle string data of this
    > size so I am okay there.
    > When the records are retrieved from the db, the data string length =0.
    > I know the data is there because I have written a Delphi data manager
    > which interrogates the db and shows all records and their contents.
    > So if ASP can handle strings this size and the data is there, why do I
    > get a data length of zero bytes returned when I interrogate the record
    > set?
    > Whichever way I cast this field I get the same result.
    >
    > I know the code is sound as it works locally through a MS SQL server
    > on my PS.
    > Anyone have this problem or know what's causing it? I have logged a
    > support call with my hosting company, but they haven't replied as yet
    > and I am stuck on an urgent project.
    >
    > Any suggestions?[/color]

    Yes one: Post the relevant pieces of your code. Today it is a beautiful
    day here in Stockholm, the sun is shining from blue skies. Nevertheless,
    I am completely in the dark about what you are doing.


    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Books Online for SQL Server SP3 at
    SQL Server 2025 redefines what's possible for enterprise data. With developer-first features and integration with analytics and AI models, SQL Server 2025 accelerates AI innovation using the data you already have.

    Comment

    Working...