|
| |
|
|
seth
Posts: 312 From: canada Status: offline
|
using get rows instead - 10/5/2006 16:57:16
I have an asp page that has many blocks of code, i'm interested in changing the record set usage to getRows method. I've read a bit on getRows and have a little understanding on it. I hoping that i'll be able to learn the rest by example. Below is one of the chunks of code that uses the RS, I was wondering if someone can convert it to get row for me so i can study the difference and apply the methodologies to the rest of the asp code blocks on the page and also throughout the entire site, thanks very much! Set objInvRS = objConn.Execute(strSQL)
If Not objInvRS.EOF Then
varInvRSInventoryID = CLng(objInvRS("InventoryID"))
varInvRSDate = CDate(objInvRS("InventoryDate"))
varInvRSAvailable = CLng(objInvRS("Available"))
varInvRSReservationID = objInvRS("ReservationID")
varInvRSProductID = CLng(objInvRS("ProductID"))
End If
For intProductIndex = 0 To (intProductCount - 1) Step 2
rowProductID = arrProduct(intProductIndex)
Response.Write "<tr id='" & rowProductID & "'>"
' write the Product Label cell
Response.Write "<td nowrap class='" & strProductClass & "' title='" & arrProduct(intProductIndex + 1) & "'>"
Response.Write "<div style='width:145px;overflow-x:hidden' class='" & strProductClass & "' > "
Response.Write arrProduct(intProductIndex + 1)
Response.Write "</div>"
Response.Write "</td>"
Response.Write "<td></td><td></td>"
objDate = objMinDate
Do Until objDate > objMaxDate
Response.Write "<td"
If objInvRS.EOF Then
Response.Write " class='invCellNone'>"
ElseIf rowProductID = varInvRSProductID And varInvRSDate = objDate Then
If varInvRSAvailable > 0 Then
' There is available inventory here
Response.Write " id='inv" & varInvRSInventoryID & "'"
Response.Write " class='invCellAvl' onMouseOver='selectInv(this)' onMouseDown='selectFirstInv(this)'>"
If blnIsHotelMode Then Response.Write varInvRSAvailable
Else
' Inventory here but it is sold
Response.Write " id='res" & varInvRSReservationID & "'"
If blnIsHotelMode Then
Response.Write " class='invCellAvlBooked'>0"
Else
Response.Write " onClick='selectReservation(" & varInvRSReservationID & ")'"
Response.Write " class='invCellAvlBooked'>"
End If
End If
objInvRS.moveNext
If Not objInvRS.EOF Then
varInvRSProductID = objInvRS("ProductID")
varInvRSDate = CDate(objInvRS("InventoryDate"))
varInvRSAvailable = objInvRS("Available")
varInvRSInventoryID = objInvRS("InventoryID")
varInvRSReservationID = objInvRS("ReservationID")
End If
Else
' No Inventory for this date and product
Response.Write " class='invCellNone'>"
End If
Response.Write "</td><td></td>"
objDate = DateAdd("d",1,objDate)
Loop
Response.Write "</tr>"
Response.Write "<tr><td colspan='" & intColspan & "'><IMG SRC='../img/transparent.gif' width='1' height='1'></td></tr>"
Next
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|