Can I insert empyt record (blank row) in a query based on condition an asp query

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Using asp and my access db, I import class rosters into a transportation log
(excel ss).

In one record field, there is a data value "instructor". I want to know,
based on the word
"instructor", can I insert 3 blank rows about the instructors row of data.

The purpose is so the instructor's information stands out when this
information goes to a hotel and
airlines.

I have the query all set up and the hope is that a conditional statement
will see "instructor", insert 3 blank rows and then display the instructor's
row of data.

Is this possible?

Do While Not rs.Eof
If rs("Att") = "Instructor"

????

Else
Response.Write rs("Att")

End If
rs.movement
loop

Thanks in advance
 
Do I understand correctly that you're gathering the data in an Access
database, and then somehow converting it to Excel?

If so, how are you doing this conversion?

--
Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
I am opening it as a spreadsheet in OE, then copying it and pasting the
sheet into a travel excel spreadsheet. The subsequent pages are already set
up to be linked to this data sheet.

Everything works well, except I want to separate the instructor.
 
Not possible with the way you are current creating the spreadsheet. You would have to use a custom
written ASP/VBScript to export the content of the database to a Excel file format.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
I don't get it. How does your appliction involve FrontPage, or at
least Web Development?

If this is really an Excel question, like how to write a macro that
does what you want, you should be posting to an Excel newsgroup.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
I use asp to query the database on the server and I get a table as a result.
with rows and columns, all written in asp and FrontPage.

The last row in the query results is one that I would like to insert blank
rows about in the asp query. I then use this in excel, not an excel question
but a Conditional query question.

Here is part of the query - the question marks seem like a logical place to
increment the query results 3 blank rows. It is not so much an excel
question but an asp question.

Dave

Do While Not rs.Eof
If rs("Att") = "Instructor"
????
Else
Response.Write rs("Att")
End If
rs.movement
loop
 
You still haven't explained how the data is getting from the access
database on the Web server to your spreadsheet.

As a result, I'm going to take a wild guess and suppose your ASP page
changes the response content-type header to application/vnd.ms-excel
or application/csv, then queries the database, and then writes
comma-separated values record into the response stream.

If so, it should be no trouble to response.write three blank record
when the condition you care about comes up.

If you're doing something else, please explain what that is.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top