• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 545
  • Last Modified:

Can't read NTEXT column with GetRows

Hi experts,
I m having problem reading the data in ntext column with the function GetRows
I try to read the a row of data into an array. There are no problem to retrieve data from the array for all columns except for the ntext data type column.

Can anyone help me with this? Thanks!

Michael Tai

0
CoolChi
Asked:
CoolChi
  • 4
  • 3
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
try to use the substring(your_ntext_field, 1, 4000) to get a usable value
0
 
CoolChiAuthor Commented:
Here's my code.....how should I change it?

RowInfo = Rs.GetRows(1)
Setting = RowInfo(5,0) <=====the column with ntext data type
Setting = Split(RowInfo(5,0),"|||")

This will end up with (Subscript out of range) error because the RowInfo(5,0) can't be retrieve.....
0
 
CoolChiAuthor Commented:
Forgot to mention that I am using ASP with VBScript on Window Server 2003 and the SQL Server for database
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
CoolChiAuthor Commented:
I am migrating my codes from Access Compatible to SQL Server
There isn't any problem with Access database and the memo data type for the column, this problem only occurs on SQL Server with ntext data type.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you might try to change the data type from NTEXT to NVARCHAR(4000), which can store up to 4000 characters.
0
 
CoolChiAuthor Commented:
Is there any other way other than this? This might temporarily help with my problem but what if when I have value that is more than 4000 characters that need to be stored?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>but what if when I have value that is more than 4000 characters that need to be stored?
you will need to split up the value into several parts (1 row per part), or use indeed NTEXT, but change alot of programming around that.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now