Re: ActualSize returns -1 for Text fields
- From: "Daniel Crichton" <msnews@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 26 Sep 2005 16:17:08 +0100
Rod wrote on Fri, 23 Sep 2005 09:59:52 -0400:
> I have a table called 'mytable' with two fields in it Fld1, and Fld2.
> Fld1 is a text field and Fld2 is char(10) . If I create an ADORecordSet
> object using the following query:
>
> select * from mytable
>
> I can't read the contents of the text field (Fld1). ActualSize of this
> field is always -1 even though I can see the data in the table from SQL
> Enterprise Manager. Same is true if I use the query explicitly listing
> the fields:
Do you read that field multiple times? IIRC, using a server side cursor the
first time you read the field ADO will then discard the underlying pointer
to that text field, and all fields to the left of it in the recordset. Then
if you attempt to read the field or it's properties a second time it will
appear as empty with a size of -1. I always read ADO recordsets from left to
write, and if I need to check the value of a field more than once then I
read it into a variable, and use the variable for subsequent tests.
Dan
.
- Follow-Ups:
- Re: ActualSize returns -1 for Text fields
- From: Rod da Silva
- Re: ActualSize returns -1 for Text fields
- References:
- ActualSize returns -1 for Text fields
- From: Rod da Silva
- ActualSize returns -1 for Text fields
- Prev by Date: How to turn a string into an ADO.Stream?
- Next by Date: Re: how to know wat is the data source name.
- Previous by thread: Re: ActualSize returns -1 for Text fields
- Next by thread: Re: ActualSize returns -1 for Text fields
- Index(es):
Relevant Pages
|
|