Requery Method Does not Work
- From: "Mel" <Mel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 10 Jan 2007 17:38:08 -0600
Why doesn't the requery method work? I have code similar to this in LOTS of
spots throughout my program but the rsCCIPinCheck recordset will not requery
when I move to the next record in the rsCCIDistinctDias recordset. I
suppose I could close and reopen rsCCIPinCheck recordset again but that
stinks. Am I doing something wrong that causes the requery method not to
work?
'*******beginning of code example
Dim conCCIWorking As New ADODB.Connection
Dim rsCCIDistinctDias As New ADODB.Recordset, rsCCIPinCheck As New
ADODB.Recordset
Set conCCIWorking = New ADODB.Connection
conCCIWorking.Open "provider = Microsoft.Jet.OleDB.4.0 ; data source =
C:\DOCUME~1\Mel\LOCALS~1\Temp\WORK.MDB;"
Set rsCCIDistinctDias = New ADODB.Recordset
With rsCCIDistinctDias
.ActiveConnection = conCCIWorking
.CursorType = adOpenDynamic
.LockType = adLockPessimistic
End With
Set rsCCIPinCheck = New ADODB.Recordset
With rsCCIPinCheck
.ActiveConnection = conCCIWorking
.CursorType = adOpenDynamic
.LockType = adLockPessimistic
End With
rsCCIDistinctDias.Open "SELECT DISTINCT [Diameter] FROM [Feature Output]
WHERE [Output Item] = True AND [Depth] = 0.01 ORDER BY [Diameter];"
rsCCIPinCheck.Open "SELECT [Feature Description] FROM [Feature Output]
WHERE [Output Item] = True AND [Depth] = 0.01 and [Diameter] = " &
rsCCIDistinctDias!Diameter & ";"
While Not rsCCIDistinctDias.EOF
'do some code here
rsCCIDistinctDias.MoveNext 'done, move to the next record
rsCCIPinCheck.Requery 'why doesn't this refresh the data in my
rsCCIPinCheck recordset?
Wend
'*******end of code example
.
- Follow-Ups:
- Re: Requery Method Does not Work
- From: Paul Clement
- Re: Requery Method Does not Work
- Prev by Date: Re: Accpac Plus Data by MsAccess
- Next by Date: Re: Requery Method Does not Work
- Previous by thread: update and delete vb code using datakeys
- Next by thread: Re: Requery Method Does not Work
- Index(es):