Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 READING NTEXT DATA TO STRING VARIABLE

Author  Topic 

ilimax
Posting Yak Master

164 Posts

Posted - 2005-03-09 : 13:05:34
Does anybody have idea whil my query does not read data from SQL Server 7.0 table, from Ntext field.

sql="Select Item, Memo from Table1;
mycmd.CommandText = sql
Set rs = mycmd.Execute

myVariable = Trim(rs!Memo)


I always have Null value in rs!Memo ... it does not see the data from Memo field.

I am using ADO 2.5 in my VB6 application

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-03-09 : 13:08:13
If an ntext column is null, you will not retrieve anything for it via ADO.
Go to Top of Page

ilimax
Posting Yak Master

164 Posts

Posted - 2005-03-09 : 13:19:25
quote:
Originally posted by robvolk

If an ntext column is null, you will not retrieve anything for it via ADO.


I do not udnerstad exactly what did you say ...I have some row where I have data in this column, and sometimes is null ...

Look my original code ... what is creazy here ...I said if is null do this, if is not do this ... but what I have here ...in first line of code "If IsNull(rs!Comments) then" I have null value but exucution skip and go to else ... then fail over there ...totally creazy ... I do not understand ...

any idea???

If IsNull(rs!Comments) Then
Discac = ""
txtSpecial.SetText Discac
Else
Discac = Trim(rs!Comments)
txtSpecial.SetText "Invoice with " & Discac & " Percent"
End If
Go to Top of Page

ilimax
Posting Yak Master

164 Posts

Posted - 2006-09-29 : 14:59:14
WRONG TEXT
Go to Top of Page
   

- Advertisement -