Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #21 (permalink)  
Old June 3rd, 2004, 02:45 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

What do you mean, Dave? Refer to whom where?

Imar
Reply With Quote
  #22 (permalink)  
Old June 3rd, 2004, 02:52 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Minneapolis, MN, USA.
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

Imar you wrote...
>>And how do you think your application knows where to look for the data? How do you think it finds your Access database or SQL Server database??

My mistake. I messed up the Access connection string on previous page. I assume you were referring to that. I should have also called
variable" an object. This day has been too long man...

Reply With Quote
  #23 (permalink)  
Old June 3rd, 2004, 03:03 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Ha, don't worry.... ;)

I was referring to this:
Code:
objEvents.ActiveConnection = CSRaceResults
This code just assigns an arbitrarily chosen variable name to the ActiveConnection, without actually passing in a valid connection string. Only later I realised the mix between the Recordset and the Command object in the code....

Cheers,

Imar
Reply With Quote
  #24 (permalink)  
Old June 3rd, 2004, 07:14 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Good morning Guys :-) (Well it's morning here, lol)

Okay I have a question for you referring to this line here

        ' Now display the Placing stuff
        Response.Write(.Fields("BoatName").Value & "(" & _
               .Fields("SailNum").Value & ")<br />")

It is displayed like this boatName(SailNum) with the bracets. How can get it to display without them. Also My original idead was to have column headings for the Html Table, Like this.

(Headings) BOAT NAME SAIL #
(Recordset) BoatName SailNum

Is there any way I can pull this off?

Thanks



-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
Reply With Quote
  #25 (permalink)  
Old June 3rd, 2004, 07:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

        Response.write "<table>"
        Response.write "<tr><td><b>BoatName</b><td>"
        Response.write "<td><b>Sail #</b><td></tr>"
   Do While Not .EOF
        If .Fields("Event").Value <> OldEventName Then
          OldEventName = .Fields("Event").Value
          Response.Write("<h2>" & .Fields("Event").Value & "</h2>")
        End If
        ' Now display the Placing stuff
        Response.write "<tr><td>"
        Response.Write(.Fields("BoatName").Value & "</td><td>" & _
               .Fields("SailNum").Value & "</td></tr>")
        .MoveNext()
   Loop
Response.write "</table>"

Hope this is what you were looking for.
Cheers!

_________________________
-Vijay G
Strive for Perfection
Reply With Quote
  #26 (permalink)  
Old June 3rd, 2004, 08:01 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay I think I got it I just moved the Do While Not.Eof line, to before the table, like this

   Do While Not .EOF
        Response.write "<table>"
        Response.write "<tr><td><b>BoatName</b><td>"
        Response.write "<td><b>Sail #</b><td></tr>"

        If .Fields("Event").Value <> OldEventName Then
          OldEventName = .Fields("Event").Value
          Response.Write("<h2>" & .Fields("Event").Value & "</h2>")
        End If
        ' Now display the Placing stuff
        Response.write "<tr><td>"
        Response.Write(.Fields("BoatName").Value & "</td><td>" & _
               .Fields("SailNum").Value & "</td></tr>")
        .MoveNext()
   Loop
Response.write "</table>"


-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
Reply With Quote
  #27 (permalink)  
Old June 3rd, 2004, 08:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

        Response.write "<table>"
   Do While Not .EOF
        If .Fields("Event").Value <> OldEventName Then
          OldEventName = .Fields("Event").Value
Response.Write("<h2>" & .Fields("Event").Value & "</h2>")
          Response.write "<tr><td><b>BoatName</b><td>"

          Response.write "<td><b>Sail #</b><td></tr>"
        End If
        ' Now display the Placing stuff
        Response.write "<tr><td>"
        Response.Write(.Fields("BoatName").Value & "</td><td>" & _
               .Fields("SailNum").Value & "</td></tr>")
        .MoveNext()
   Loop
Response.write "</table>"

Is this what you wanted? Hope I have understood;) that. lol
Cheers!

_________________________
-Vijay G
Strive for Perfection
Reply With Quote
  #28 (permalink)  
Old June 3rd, 2004, 08:31 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks happygv :):):):):):):)

That seems to work great, I just have to add more records and see if they display right.


-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
Reply With Quote
  #29 (permalink)  
Old June 3rd, 2004, 09:01 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay I know I am a pain but I have another question

When I have more than one record under this line
    ' Now display the Placing stuff
It makes it's own table and it dosen't look right
But if I move the Do while not.eof under the Response.write "<table border=1>" It dosen't work the way I want it too.

So the headings and first record make one table
Then any more records after that make there own table and don't line up under the headings.

  Do While Not .EOF
 Response.write "<table border=1>"

 If .Fields("Event").Value <> OldEventName Then
  OldEventName = .Fields("Event").Value

 Response.Write("<h2>" & .Fields("Event").Value & "</h2>")

 Response.write "<tr><td><b>BoatName</b></td>"
 Response.write "<td><b>Sail #</b></td>"
 Response.write "<td><b>Type</b></td>"
 Response.write "<td><b>Date</b></td>"
 Response.write "<td><b>Position</b></td>"
 Response.write "<td><b>Time</b></td></tr>"

End If

' Now display the Placing stuff

Response.write "<tr><td>"

Response.Write(.Fields("BoatName").Value & "</td><td>" & _
.Fields("SailNum").Value & "</td><td>" & _
.Fields("Type").Value & "</td><td>" & _
.Fields("RaceDate").Value & "</td><td>" & _
.Fields("Position").Value & "</td><td>" & _
 .Fields("RaceTime").Value & "</td><td></tr>")
.MoveNext()
   Loop

Response.write "</table>"

I think I need to loop seperatley through the bottom half under the
' Now display the Placing stuff
so it stays in the same table, instead of going back up to the top and looping through everything again

Thanks


-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
Reply With Quote
  #30 (permalink)  
Old June 3rd, 2004, 09:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

There was one <TD> extra in your code between the RED code down there, I removed it and rearranged the code. Please see below. New code lines are bolded out.

Code:
 Response.write "<table border=1>"
 Response.write "<tr><td><b>Event Name</b></td>"
 Response.write "<tr><td><b>BoatName</b></td>"
 Response.write "<td><b>Sail #</b></td>"
 Response.write "<td><b>Type</b></td>"
 Response.write "<td><b>Date</b></td>"
 Response.write "<td><b>Position</b></td>"
 Response.write "<td><b>Time</b></td></tr>"
Do While Not .EOF
 If .Fields("Event").Value <> OldEventName Then
  OldEventName = .Fields("Event").Value
 Response.Write("<tr><td colspan=7><h2>" & .Fields("Event").Value & "</h2></td></tr>")
Else
 Response.Write("<tr><td colspan=7>&nbsp;</td></tr>")
End If

' Now display the Placing stuff

Response.write "<tr><td>"
Response.Write(.Fields("BoatName").Value & "</td><td>" & _
.Fields("SailNum").Value & "</td><td>" & _
.Fields("Type").Value & "</td><td>" & _
.Fields("RaceDate").Value & "</td><td>" & _
.Fields("Position").Value & "</td><td>" & _
.Fields("RaceTime").Value & "</td></tr>")
.MoveNext()
   Loop
Response.write "</table>"
Does this work the way you wanted?
Cheers!

_________________________
-Vijay G
Strive for Perfection
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop through 17 tables in RecordSet object didimichael C# 1 July 18th, 2008 06:53 AM
loop through tables inside .mdb file using VB.NET remya1000 General .NET 3 September 24th, 2007 12:45 PM
creating tables within tables in access??? carswelljr Access 3 August 23rd, 2006 01:21 PM
Help with for-each loop athanatos XSLT 0 April 10th, 2006 07:20 PM
nested while loop doesn't loop hosefo81 PHP Databases 5 November 12th, 2003 08:46 AM



All times are GMT -4. The time now is 01:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.