Strange problem with nvarchar(max) fields and Classic ASP

前端 未结 7 1136
猫巷女王i
猫巷女王i 2020-12-04 03:07

I\'m working on a Classic ASP (VBScript) site that\'s running on a Windows 2008 server with IIS7 and hitting a SQL Server 2008

7条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 03:46

    I just had a similar problem (only with SQL Server 2005, not 2008):

    If Not IsNull(rs("Title")) Then
        Response.Write "The title: " & rs("Title") 
    End If
    

    The Response.Write was executed, but the title itself was not displayed.

    It took me quite some time until I figured out that the combination of ASP Classic and nvarchar(max) was causing the problem.
    Then I found this and did what was described there...I changed my code to this:

    SomeVariable = rs("Title")    
    If Not IsNull(SomeVariable) Then
        Response.Write "The title: " & SomeVariable 
    End If
    

提交回复
热议问题