Has anyone run into this?
I use the same recordset over in a processing loop by just closing it.
' CHECK RECORDSET STATE, IF OPEN THEN CLOSE
If objAdoMP08RecordSet3.State = adStateOpen Then
objAdoMP08RecordSet3.Close
End If
strQuery = "select pieces_per_pad_qty, green_style from design_screen_area_uv01 where screen_nbr = '" & strScreenNbr & "' and chip_style = '" & strChipStyle & "'"
' OPEN THE RECORD SET
objAdoMP08RecordSet3.Open strQuery
The problem is when it hits the recordset.open it throws an error: -2147217915 'Object was open.'
When I step through the code the value for
objAdoMP08Recordset3.state is 0 which is closed in the
line of code before setting the query.
The recordeset object only gets created once before the processing loop:
' ***** INSTANTIATE THE RECORDSET OBJECT *****
Set objAdoMP08RecordSet3 = New ADODB.Recordset
'PASS THE ACTIVE CONNECTION TO THE RECORDSET OBJECT
objAdoMP08RecordSet3.ActiveConnection = ObjAdoMP08Connection
'SET THE CURSORTYPE TO "STATIC"
objAdoMP08RecordSet3.CursorType = adOpenStatic
Thanks,
Keith
I use the same recordset over in a processing loop by just closing it.
' CHECK RECORDSET STATE, IF OPEN THEN CLOSE
If objAdoMP08RecordSet3.State = adStateOpen Then
objAdoMP08RecordSet3.Close
End If
strQuery = "select pieces_per_pad_qty, green_style from design_screen_area_uv01 where screen_nbr = '" & strScreenNbr & "' and chip_style = '" & strChipStyle & "'"
' OPEN THE RECORD SET
objAdoMP08RecordSet3.Open strQuery
The problem is when it hits the recordset.open it throws an error: -2147217915 'Object was open.'
When I step through the code the value for
objAdoMP08Recordset3.state is 0 which is closed in the
line of code before setting the query.
The recordeset object only gets created once before the processing loop:
' ***** INSTANTIATE THE RECORDSET OBJECT *****
Set objAdoMP08RecordSet3 = New ADODB.Recordset
'PASS THE ACTIVE CONNECTION TO THE RECORDSET OBJECT
objAdoMP08RecordSet3.ActiveConnection = ObjAdoMP08Connection
'SET THE CURSORTYPE TO "STATIC"
objAdoMP08RecordSet3.CursorType = adOpenStatic
Thanks,
Keith