Ask a Question related to ASP Database, Design and Development.
-
Joe #1
displaying a particular record in a particular location
Greetings,
I am working with two recordsets and I wish to display the last record
from one of those sets in a particular place on a page, and then loop
through the other records of the same set at another part of my page.
The recordset in question contains 3 records. I have 1 through 2 at
one place and I want to have the third record display'd somewhere else
(not in the loop that displays the first two).
I have the looping display OK, I am just lost as how to display the
other record (the last record) at a place of my choice.
Thanks all
[email]joeweissjrSPAMOSPAMO@hotmail.com[/email]
Joe Guest
-
Only 1 record displaying?
Hi, I have a problem with Dreamweaver MX2004. I create my page as defined by the tutorial; connect to to my SQL database fine, displaying all the... -
Displaying the newest record first..
I know this is probably a brain dead question, but I can't remember how to display the latest database entry first, and the oldest entry last. Any... -
Displaying only a part of a record field
I would like to output only a part of a record field which is returned by a query. For example the outputed text would look like: "Drawing has... -
Displaying Date From a Database Record
Hi, Can anyone help??? I am trying to display the date that a record was posted to a database to an asp page but it appears in the wrong format... -
Quick Record location - is it possible?
You can use the wizard to make a search combo box. I would try placing it in the forms header part. If you database small (1000 record range),... -
Ray at #2
Re: displaying a particular record in a particular location
You could stick your rs into an array:
Set rs = yourConn.execute("select [col1],[col2],[col3],[col4] from
[theTable]")
If Not rs.EOF Then aRecords = rs.GetRows()
rs.Close
Set rs = Nothing
yourConn.Close
Set yourConn = Nothing
Then, if you want record number 3, you can do:
response.write Records(0, 2)
response.write Records(1, 2)
response.write Records(2, 2)
response.write Records(3, 2)
That would be the same as:
rs(0), (1), (2), (3) of the third record, which is index value 2 in the base
0 array.
Ray at work
"Joe" <joew@vca.com> wrote in message
news:1448d55e.0307211104.6c180d1d@posting.google.c om...> Greetings,
>
> I am working with two recordsets and I wish to display the last record
> from one of those sets in a particular place on a page, and then loop
> through the other records of the same set at another part of my page.
> The recordset in question contains 3 records. I have 1 through 2 at
> one place and I want to have the third record display'd somewhere else
> (not in the loop that displays the first two).
>
> I have the looping display OK, I am just lost as how to display the
> other record (the last record) at a place of my choice.
>
> Thanks all
>
> [email]joeweissjrSPAMOSPAMO@hotmail.com[/email]
Ray at Guest
-
Joe #3
Re: displaying a particular record in a particular location
Thanks, here is a question on the same tangent:
If I am going to be joining a few tables, how would I display the
loop'd data for various records in different places?
ie:
"SELECT Events.eventTitle, Events.eventDesc, AheadDave.articleLead,
AheadDave.articleDesc FROM Events, AheadDave WHERE monthID = 3"
(above code may be schetchy - but that's the gist of what I'm after)
I am going to loop through all of a few particluar records from table1
MyRS("eventTitle")
MyRS("eventDesc")
and display them somewhere (in a table, let's say in the center of my
page)
I then want to be able to loop through & display other records from
that join select statement
MyRS("articleLead")
MyRS("articleDesc")
in another part of the page.
Does that make sense?
Joe Guest
-
Ray at #4
Re: displaying a particular record in a particular location
That would still be fine, because the recordset will still be returned as
just a two dimensional set of data that can be stuck into an array. In this
case, eventTitle and eventDesc would be YourArray(iRecordNumber, 0) and
YourArray(iRecordNumber, 1), respectively. articleLead and articleDesc
would be YourArray(iRecordNumber, 2) and YourArray(iRecordNumber, 3)
respectively.
Whether your data comes from just one single table or a 5000 table join,
that won't make a difference.
Ray at work
"Joe" <joew@vca.com> wrote in message
news:1448d55e.0307221150.35b92a66@posting.google.c om...> Thanks, here is a question on the same tangent:
>
> If I am going to be joining a few tables, how would I display the
> loop'd data for various records in different places?
>
> ie:
> "SELECT Events.eventTitle, Events.eventDesc, AheadDave.articleLead,
> AheadDave.articleDesc FROM Events, AheadDave WHERE monthID = 3"
> (above code may be schetchy - but that's the gist of what I'm after)
>
> I am going to loop through all of a few particluar records from table1
>
> MyRS("eventTitle")
> MyRS("eventDesc")
>
> and display them somewhere (in a table, let's say in the center of my
> page)
>
>
> I then want to be able to loop through & display other records from
> that join select statement
>
> MyRS("articleLead")
> MyRS("articleDesc")
>
> in another part of the page.
>
>
> Does that make sense?
Ray at Guest
-
Joe #5
Re: displaying a particular record in a particular location
I'm almost there...
Here is my quandry (with a bit of my code - feel free to point out
ugly spots)
I have two tables that I'm working with
july03
events
Here is my select statement:
MySQL = "SELECT july03.*, events.* FROM july03 LEFT OUTER JOIN events
ON events.month=july03.month"
MyRS.Open MySQL, MyConn
july03Array = MyRS.GetRows(,,"title")
MyRS.MoveFirst
eventsArray = MyRS.GetRows(,,"titleEvent")
MyRS.Close
Set MyRS = Nothing
MyConn.Close
Set MyConn = Nothing
(this returns me 13 records from 'july03' and 2 records from 'events')
Here is what I want to do...
I want to write out/loop through the records from the july03 table and
then write out/loop through the records from the events table.
I came up with this code but it is not doing what I need:
Dim rowLoop, colLoop
for rowLoop = 0 to UBound(july03Array, 2)
for colLoop = 0 to UBound(july03Array, 1)
response.write(july03Array(colLoop, rowLoop) & "<br>")
next
next
response.write "NEXT GROUP <BR><BR>"
for rowLoop = 0 to UBound(eventsArray, 2)
for colLoop = 0 to UBound(eventsArray, 1)
response.write(eventsArray(colLoop, rowLoop) & "<br>")
next
next
If you could provide me with some code/instruction to get what I am
after I would be most appreciative.
Thanks
Joe
Joe Guest



Reply With Quote

