Re: Cannot Read Varchar(max)
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Fri, 23 May 2008 21:47:50 +0000 (UTC)
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
.
- References:
- Cannot Read Varchar(max)
- From: netzorro
- Re: Cannot Read Varchar(max)
- From: Plamen Ratchev
- Re: Cannot Read Varchar(max)
- From: netzorro
- Re: Cannot Read Varchar(max)
- From: Plamen Ratchev
- Re: Cannot Read Varchar(max)
- From: netzorro
- Cannot Read Varchar(max)
- Prev by Date: Re: confusion over indexs via primary key and clustered index
- Next by Date: Re: Cannot Read Varchar(max)
- Previous by thread: Re: Cannot Read Varchar(max)
- Next by thread: Re: Cannot Read Varchar(max)
- Index(es):
Relevant Pages
|
|