In a recently update to SQL Server 2022, the data from the varchar(max) fields has stopped being displayed (or being saved in variables) on a website made with ASP Classic.
How can I solve this problem?
Here is the code:
<%
set db = server.CreateObject("ADODB.Connection")
set rs = server.CreateObject("ADODB.Recordset")
db.Open(connectionstring)
'Page is varchar(10) and Content is varchar(MAX)
sql = "SELECT Page, Content FROM Aux_Config"
rs.open sql,db,1
while not rs.EOF
response.write("<br/>Element: " & rs.fields("Page"))
If rs.fields("Content")="" Then
response.write("<br/>Content: (empty)")
Else
response.write("<br/>Content: " & rs.fields("Content"))
End If
rs.movenext
wend
rs.close
%>
I have tried with different connection strings:
connectionstring="Driver={SQL Server};Server=server;Database=database;Uid=user;Pwd=password;"
connectionstring="Driver={ODBC Driver 11 for SQL Server};Server=server;Database=database;Uid=user;Pwd=password;"
connectionstring="Driver={ODBC Driver 17 for SQL Server};Server=server;Database=database;Uid=user;Pwd=password;"