Problem reading Text data type from SQL Server 
Author Message
 Problem reading Text data type from SQL Server

I have a field of text data type in one of the tables in ms sql server 6.5.
My VB program behaves strangely when accessing this column. It reads it the
first time but loses the data when the recordset is accessed the 2nd time.

if Not IsNull(Rs1("description")) Then

        text1 = Rs1("description")

end if

In the If condition it correctly finds the data however on assigning it to
text box it gives an error 'Invalid null assignment'. I have debuged and
found it to be true. When I move the mouse pointer over to check, I can see
what text is in there however if  I move the mouse pointer and bring it back
again the second time it shows null. Whats going on and how can I solve
this.  I've tried to convert the data type to char or varchar by changing
the query to some thing like this

select convert(char(50),description)...

Now it gives garbage instead of null every time. I'm using VB 6 and RDO.


Sat, 14 Dec 2002 03:00:00 GMT  
 Problem reading Text data type from SQL Server

This is a documented problem if you're using RDO.  See MSDN.  Also see MSDN
for suggestions on reading BLOB data--one of which is that it be returned as
the last field of its resultset.


Sat, 14 Dec 2002 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Problem reading Text data type from SQL Server

2. Retrieving SQL Server Text data type in VB.NET

3. Accesssing SQL Server Text data types using RDO


5. ADO Data type for SQL Server Text

6. SQL Server Text Data Type

7. SQL Server 'Text' Data Type Field

8. Problem on SQL-Update Statement with a Data-Control in VB 5 and SQL Server 7.0

9. Data Type Constants in SQL Server 6.5

10. Sql server Image data type

11. OLE object data type in SQL Server 6.5

12. Store the image in picture box control into the image data type in SQL server


Powered by phpBB® Forum Software