By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 1,795 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

text column in mysql returns a null or "" value with ASP

P: n/a
Ok, I have a page that queries a database and retrieves values to
create a custom report in ms excel format on the fly so that it can be
downloaded. I can use the following sub to generate the report just
fine. It works correctly for every field in the database and creates
the report as desired except for one field and one field only. The
column type for this field is the text data type in MySQL. I chose
this type because, the field may be longer than 255 characters (this
field is used for comments). All my varchar, number and date columns
return values as expected. However with the text column, I get no
return (or "") for any query. In some cases I'm doing a "SELECT *
FROM " sort of query so I know that its not a problem with specifying
the column correctly in my query statement. It seems to have
something to do with datatype of this field and I would suspect that I
need to format it somehow but am unsure how to do so.

Thanks,

Mike

Sub CreateDownloadable()
'create the file to be downloaded to the user
Response.ContentType = "application/octet-stream"
Response.AddHeader "content-disposition", "attachment; filename=" &
Filename

Call OpenConnection
Dim MyRS
Set MyRS = adoConn.Execute(sqlStatement)
Dim i

For i = 0 to MyRS.Fields.count - 1
Response.Write myRS(i).name & vbTab
Next
Response.Write vbLf

If MyRS.EOF Then
Response.Write "No Records Were Found Matching the Search Criteria!"
End If

While Not MyRS.EOF
For i = 0 to MyRS.Fields.count - 1
If MyRS(i) = "" Then
Response.Write vbTab
Else
Response.Write MyRS(i) & vbTab
End If
Next
Response.Write vbLf
MyRS.MoveNext
Wend

MyRS.Close
Call CloseConnection()

End Sub
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> return (or "") for any query. In some cases I'm doing a "SELECT *
FROM " sort of query so I know that its not a problem with specifying
the column correctly in my query statement.


Stop doing that!
http://www.aspfaq.com/2188

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.