473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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

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
1 2944
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Don Vaillancourt | last post by:
What's going on with Javascript. At the beginning there was the "undefined" value which represented an object which really didn't exist then came the null keyword. But yesterday I stumbled...
1
by: Pekka Henttonen | last post by:
For some reason SQL0407N error messages never reveal the name of the column to which a NULL value has been assigned. Here is an example: SQL0407N Assignment of a NULL value to a NOT NULL column...
3
by: google | last post by:
This is something I've done plenty of times in '97, but I can't seem to get it to work correctly in Access 2003. Say, for example, I have a form with an unbound combobox, the data source is a...
2
by: gabon | last post by:
I'm creating a select entirely through JavaScript and very strangely IE doesn't show the text in the option elements. Here part of the code: this.form_country=document.createElement("select");...
1
by: Col | last post by:
Begin() method applied on empty Vector returns NULL or non null value???? Plz help!!! Thanks&regards, COL
1
by: serge | last post by:
Does anyone know what it means when i see some records returned that have their COLUMN value as NULL? I investigated a little to see if they are somehow related to orphaned users but I don't...
2
by: Jeff | last post by:
Hey I've bought the book "ASP.NET 2.0 website programming, Problem, Design, Solution" and some of its code examples is this code: protected static string ConvertNullToEmptyString(string input)...
16
by: mj.redfox.mj | last post by:
Can anyone help? I have a textbox which I'm programatically adding by using the following code: txtTest = New TextBox txtTest.ID = "txtLeft" + cntCount.ToString...
1
by: djdarpan | last post by:
Hi, I am new with MySql and PHP. I have a problem while I am checking NULL value in database. I need If there is empty field in my table row return message "Somthing "and if there is...
0
by: dodoG | last post by:
Hello, I have qestion about mysql: Why we should define in mysql value that primary key also NULL? for example: CREATE TABLE `ae_gallery` ( `id` int(11) NOT NULL AUTO_INCREMENT, ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.