Forum Moderators: open

Message Too Old, No Replies

Wrong Output

response.write output incorrect

         

webtress

5:51 am on Sep 14, 2003 (gmt 0)

10+ Year Member



I am trying create a csv file from the following, all fields are in the table being refereced, however the field for section outputs the number value that is assigned at the time the section is created. This number value is in a different table and not being called here. When I view the table the field shows the correct name for the sections but the response output isn't correct. The sections field uses a dropdown box. Any Ideas or help would be greatly appreicated.

Response.ContentType = "unknown/exe"
if request.form("act")="items" then
Response.AddHeader "Content-Disposition","attachment;filename=items.csv"
end if
Set rs = Server.CreateObject("ADODB.RecordSet")
Set cnn=Server.CreateObject("ADODB.Connection")
cnn.open sDSN
request.form("act")="items" then
sSQL2 = "SELECT ID,Name,Section,Price, FROM miscproduct"
rs.Open sSQL,cnn,0,1
response.write """ID"",""Name"",""Section"",""price"" &vbCrLf
do while NOT rs.EOF
response.write """"&replace(rs("ID"),"""","""""")&""","
response.write """"&replace(rs("Name"),"""","""""")&""","
response.write """"&replace(rs("Section"),"""","""""")&""","
response.write rs("Price")&","&vbCrLf
rs.MoveNext
loop
rs.Close

current output:
section
58
58
60
60
59

should be (this is how it views in access):
section
shoes
shoes
handbags
handbags
gloves

Thank you in advance for any help you provide

Marlene

bmcgee

12:30 am on Sep 15, 2003 (gmt 0)

10+ Year Member



You are opening sSQL, instead of the sSQL2 that you set here (and presumably meant to use).

I presume the data you are getting are the results of your sSQL query, right?

webtress

2:41 am on Sep 15, 2003 (gmt 0)

10+ Year Member



bmcgee,

That was a typo. I am opening sSQL2 and the results are form the sSQL2 query.