Results 1 to 1 of 1

Thread: [Solved]Problems with nvarchar(max) and asp?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Kalix, Norrbotten, SWEDEN

    [Solved]Problems with nvarchar(max) and asp?

    Anyone encountered this weired problem and can explain why...


    Database: SQL Server 2005
    ASP: ASP 3.0

    I have a table with several fields that conatin int, datetime, nvarchar(50) and a couple with nvarchar(max). The order of the fields is like this,

    int, nvarchar(50), nvarchar(max), nvarchar(max), datetime

    Now I retrive data from this table with ADO recordset. This works great. No problems with retriving the data.

    The problem starts when outputting the data from the recordset. If I retrive one of the nvarchar(max) field every other field is lost, not data exsist in them. Like if I retive the nvarchar(max) before the int and nvarchar(50) the data in the int and nvarchar(50) is lost, ie NULL. If I howevere loop thru the recordset and retrive the fields in the "correct" order it works. But If I decide to retrive data from nvarchar(max) twice, it is also put to NULL.

    So I changed my datatypes from nvarchar(max) to nvarchar(4000) it works with no problem. Can loop, check data, basiclly to what ever I want with the recordset. Why would nvarchar(MAX) cause this problems?

    Also, I open the recordset the old fashion why with open, not getrows. Could this be the problem?

    Needed to use GetChunk method to retrive large datatypes from a sql server recordset.
    Last edited by Smirre; May 3rd, 2006 at 06:55 AM. Reason: Solved
    Visual Basic
    C, C++
    SQL Server


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