|
 |
asp_databases thread: oRs.NextRecordset
Message #1 by Jerry Diegel <jerryd@h...> on Fri, 19 Jan 2001 16:41:43 -0600
|
|
With oRs
.ActiveConnection = PBODBCNAME
strSQL = "SELECT BuilderItem.BuilderItemKey, ItemType.ItemType,
BuilderItem.Description, Manufacturer.CompanyName, BuilderItem.Modelnbr " &
_
"FROM BuilderItem INNER JOIN " & vbcrlf & _
" Manufacturer ON " & vbcrlf &_
" BuilderItem.ManufacturerKey = Manufacturer.ManufacturerKey " & _
" INNER JOIN ItemType ON " & _
" BuilderItem.ItemTypeKey = ItemType.ItemTypeKey " & _
"WHERE BuilderItem.ItemTypeKey = '" & strItemTypeKey & "' and
BuilderItem.BuilderKey = '" & hwsBuilderkey & "' " & _
"SELECT BuilderItem.BuilderItemKey, ItemType.ItemType,
BuilderItem.Description, Manufacturer.CompanyName, BuilderItem.Modelnbr " &
_
"FROM BuilderItem INNER JOIN " & _
" Manufacturer ON " & _
" BuilderItem.ManufacturerKey = Manufacturer.ManufacturerKey " & _
" INNER JOIN ItemType ON " & _
" BuilderItem.ItemTypeKey = ItemType.ItemTypeKey " & _
"WHERE BuilderItem.WorkTypeKey = '" & strWorkTypeKey & "' and " & _
" BuilderItem.ItemTypeKey != '" & strItemTypeKey & "' and " & _
" BuilderItem.BuilderKey = '" & hwsBuilderkey & "' " & _
"Order By ItemType.ItemType"
Response.Write strSQL
.CursorType = 0 'adOpenForwardOnly
.Open strSQL
If not oRs.EOF then
arr1 = .GetRows
Set oRs = oRs.NextRecordset
If Not(oRs is Nothing) then
If not .EOF then ' **** Errors Out Here **** '
arr2 = .GetRows
End If
End If
arr = CombineArr(arr1,arr2)
Else
'Redirect Is going here later
End If
End With
____________________________________________________________________________
___________
The recordset opens fine and I get the first recordset no problem, but when
I try to move the pointer to the next recordset the Not(oRs is Nothing)
returns True, but the test for .EOF aftward causes an "Operation is not
allowed when the object is closed." If I run the ouput from
"Response.Write strSQL" in Query Analyzer I get 2 sets of records back.
Does anyone know whats up with this?
Message #2 by Jerry Diegel <jerryd@h...> on Fri, 19 Jan 2001 17:07:54 -0600
|
|
I've already fixed this. When I was resetting the object, "Set oRs
oRs.NextRecordset", it no longer fit within the context of the With block.
When I removed the With block everything worked fine. Kind of felt silly
when realized this.
-----Original Message-----
From: Jerry Diegel [mailto:jerryd@h...]
Sent: Saturday, January 20, 2001 1:07 AM
To: ASP Databases
Subject: [asp_databases] oRs.NextRecordset
With oRs
.ActiveConnection = PBODBCNAME
strSQL = "SELECT BuilderItem.BuilderItemKey, ItemType.ItemType,
BuilderItem.Description, Manufacturer.CompanyName, BuilderItem.Modelnbr " &
_
"FROM BuilderItem INNER JOIN " & vbcrlf & _
" Manufacturer ON " & vbcrlf &_
" BuilderItem.ManufacturerKey = Manufacturer.ManufacturerKey " & _
" INNER JOIN ItemType ON " & _
" BuilderItem.ItemTypeKey = ItemType.ItemTypeKey " & _
"WHERE BuilderItem.ItemTypeKey = '" & strItemTypeKey & "' and
BuilderItem.BuilderKey = '" & hwsBuilderkey & "' " & _
"SELECT BuilderItem.BuilderItemKey, ItemType.ItemType,
BuilderItem.Description, Manufacturer.CompanyName, BuilderItem.Modelnbr " &
_
"FROM BuilderItem INNER JOIN " & _
" Manufacturer ON " & _
" BuilderItem.ManufacturerKey = Manufacturer.ManufacturerKey " & _
" INNER JOIN ItemType ON " & _
" BuilderItem.ItemTypeKey = ItemType.ItemTypeKey " & _
"WHERE BuilderItem.WorkTypeKey = '" & strWorkTypeKey & "' and " & _
" BuilderItem.ItemTypeKey != '" & strItemTypeKey & "' and " & _
" BuilderItem.BuilderKey = '" & hwsBuilderkey & "' " & _
"Order By ItemType.ItemType"
Response.Write strSQL
.CursorType = 0 'adOpenForwardOnly
.Open strSQL
If not oRs.EOF then
arr1 = .GetRows
Set oRs = oRs.NextRecordset
If Not(oRs is Nothing) then
If not .EOF then ' **** Errors Out Here **** '
arr2 = .GetRows
End If
End If
arr = CombineArr(arr1,arr2)
Else
'Redirect Is going here later
End If
End With
____________________________________________________________________________
___________
The recordset opens fine and I get the first recordset no problem, but when
I try to move the pointer to the next recordset the Not(oRs is Nothing)
returns True, but the test for .EOF aftward causes an "Operation is not
allowed when the object is closed." If I run the ouput from
"Response.Write strSQL" in Query Analyzer I get 2 sets of records back.
Does anyone know whats up with this?
|
|
 |