Re: Cannot Read Varchar(max)



netzorro (netzorro@xxxxxxxxxxxxxx) writes:
The code is like this:
oRecordset = getRecordset("select myText from myTable");

while (!oRecordset->IsEOF())
{
oRecordset->GetFieldValue(1,oData);
if (oData.m_dwType == DBVT_ASTRING)
{
sAux = *oData.m_pstringA;
}
oRecordset->MoveNext();
}


If myText is Text or varchar(n) it works fine. But if myText is
varchar(max) *oData.m_pstringA points to an empty string.

Wait, didn't you say that you were using ODBC? This looks like ADO
to me.

What does your connection string look like? If you have
PROVIDER=SQLNCLI, try adding DataTypeCompatibility=80 to the
connection string. ADO does not understand the new data types
added to SQL 2005 very well.





--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: Linked Server - Force Translate
    ... I had the same issue when using a connection string with same ... > see sp_addlinkedserver in Books Online for details. ... > You can also use OPENROWSET and specify a connection string with it. ... > Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se ...
    (microsoft.public.data.oledb)
  • Re: sql express 2005 security
    ... Or...you can encrypt your connection string inside your app.config file like ... And, yes, this means that the user will be able to connect to the database ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.security)
  • Re: Password expired
    ... use within the connection string. ... I ass that you use ASP .Net, so I guess that you are using SqlClient as ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.security)
  • Re: Password expired
    ... use within the connection string. ... the Old Password property. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.security)
  • Re: Password expired
    ... use within the connection string. ... The old password you pass in the Old Password property. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.security)