MySQL Forums
Forum List  »  Quality Assurance

Lose text field data in recordset after 1st use
Posted by: Rob van Tuin
Date: August 02, 2008 11:02PM

Hi,
I have a strange problem, and I’m not sure if it is a MySQL, ASP or ODBC problem.

If I get a TEXT, LONGTEXT or MEDIUMTEXT field from the MySQL database with Classic ASP and OBDC, I will lose the recordset data after I use it once for example:

SQL = "SELECT ShowDisc FROM `nw_shows`"
Set rs = dbConn.Execute (SQL)
If Not rs.EOF Then
Response.Write("<b>First Time</b><br />")
Response.Write(rs("ShowDisc") & "<br /><br />")
Response.Write("<b>Second Time</b><br />")
Response.Write(rs("ShowDisc") & "<br /><br />")
End If

The output of this:
---------------------------------------
First Time
Here is the text field data

Second Time

---------------------------------------

So I can use the data once the second time I want to use the same recordset data it is empty

But if I CAST the data as CHAR it will retain the data for example:

SQL = "SELECT CAST(ShowDisc AS CHAR) FROM `nw_shows`"
Set rs = dbConn.Execute (SQL)
If Not rs.EOF Then
Response.Write("First Time<br />")
Response.Write(rs("ShowDisc") & "<br /><br/>")
Response.Write("Second Time<br />")
Response.Write(rs("ShowDisc") & "<br /><br />")
End If

The output of this:
---------------------------------------
First Time
Here is the text field data

Second Time
Here is the text field data
---------------------------------------

Dos anybody has any inside on this problem?

Server information:
Dual Xeon E5405
Windows Server 2003 R2
MySQL 5.0.45
ASP 6.0.3790.4195
ODBC 3.51.26.00

Options: ReplyQuote


Subject
Views
Written By
Posted
Lose text field data in recordset after 1st use
5089
August 02, 2008 11:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.