|
-
Nov 13th, 2008, 10:50 AM
#1
Thread Starter
Member
[2005] MySQL 'TEXT' field returns a NULL value to ADODB Recordset
Hello again, all. I've run into an interesting phenomenon, and was hoping that someone here might be able to provide me with some guidance/direction:
I'm building an internal HelpDesk ticketing system that retrieves error details from a custom application we have built here and stores them to a MySQL database. For the purposes of work logs and such, some of the fields in the MySQL database need to have the capacity for fairly large amounts of text data, so I have set them as TEXT instead of VARCHAR.
I connect to the database using an ADODB recordset to retrieve the HelpDesk ticket details, including the data from these TEXT fields. The interesting thing here is, as soon as the recordset is opened, it has the data from these fields. However, the moment it moves on to the next instruction in my application, the TEXT field data seems to drop out of the recordset completely. That is, RS.Fields(X).Value returns the actual content of the field when the recordset is opened, but on the very next instruction, it changes to System.DBNull.
None of the other fields have this problem, so I tried changing the format of the field over to VARCHAR (this is a new application without much data, so I'm not worried about losing anything just yet). Sure enough, when it got the recordset this time, it retained the string value from the field. I went back to my TEXT field format and tried requerying the database just before the instruction where I need this particular field value with RS.Requery(), but it still dropped the data out of the recordset before I could grab it. I even tried setting a separate recordset with JUST that field, but no luck.
So, my question is, is there something I'm missing here? Is there some reason that VB seems to drop the contents of TEXT fields out of the recordset? Is there a way to get it to retain the data?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|