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

Discussion in 'ASP General' started by mike, Sep 15, 2004.

  1. mike

    mike Guest

    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
    mike, Sep 15, 2004
    #1
    1. Advertising

  2. > 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.)
    Aaron [SQL Server MVP], Sep 16, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Web learner
    Replies:
    5
    Views:
    19,689
    Web learner
    Apr 6, 2006
  2. vizlab
    Replies:
    3
    Views:
    4,200
    Michael Bar-Sinai
    Oct 17, 2007
  3. Replies:
    5
    Views:
    26,611
    Mike Schilling
    Mar 29, 2006
  4. Col
    Replies:
    1
    Views:
    623
    peter koch
    Apr 21, 2006
  5. Greg Smith
    Replies:
    0
    Views:
    539
    Greg Smith
    Apr 12, 2007
Loading...

Share This Page