Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 26th, 2003, 03:49 PM
Friend of Wrox
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default Can't pull data from ntext field into recordset.

Hi All,

Glad to see your smiling faces again.

Imported data from an ntext field. The source and destination fields are both ntext.

After getting the data imported, I can't pull any data from that field into the recordset, into the variable.

Features = oRS("Features")
Response.Write Features

This returns nothing, but I can go into QA and see data.

If I change the data type to varchar, I can pull the data into the recordset but because of the length of that datatype, the data is truncated.

Does anyone know why this is happening and how I can resolve it?

Really appreciate your responses.

Thank you,
Richard Stelma

Old August 26th, 2003, 04:07 PM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi Richard,

In what order do you retrieve the Ntext / Blob from the database? There used to be (maybe still are) some problems with ADO when you requested the BLOB before other fields in the code.

So this would fail:

(SELECT Blob, AnInt FROM MyTable)
while this would work:

(SELECT AnInt, Blob FROM MyTable)
Hope this helps,


Imar Spaanjaars
Everyone is unique, except for me.
Old August 26th, 2003, 04:50 PM
Friend of Wrox
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts

Hi Imar,

It worked! I've had this ordering problem before and never new it was directly related with pulling ntext/blob datatypes.

Although, I didn't pull the BLOB last. I did assign the variable value in the same order that the fields were pulled in the SQL statement. And that did work.

SQL = "Select this, that, BLOB, theother from Table1;"
Set oRS = oConn.Execute(SQL)

this = oRS("this")
that = oRS("that")
theBlob = oRS("BLOB")
theother = oRS("theother")

Thank you so much for your reply. You've saved me so much time and trouble.

Thank you,

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wildcard on nText field rit01 SQL Server 2000 1 March 17th, 2006 12:48 PM
How to Search in nTEXT or TEXT field gaupa SQL Server 2000 1 December 21st, 2004 07:48 AM
Regarding Inserting values to ntext field Hari_Word ADO.NET 1 August 31st, 2004 05:15 PM
Pull years from date field kev_79 Access 2 August 2nd, 2004 01:49 PM
Can't pull data from ntext field into recordset. rstelma Classic ASP Databases 1 August 26th, 2003 03:21 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.