Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 26th, 2003, 03:49 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old August 26th, 2003, 04:07 PM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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:

Code:
(SELECT Blob, AnInt FROM MyTable)
Response.Write(Recordset("Blob"))
Response.Write(Recordset("AnInt"))
while this would work:

Code:
(SELECT AnInt, Blob FROM MyTable)
Response.Write(Recordset("AnInt"))
Response.Write(Recordset("Blob"))
Hope this helps,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old August 26th, 2003, 04:50 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

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,
Richard

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.