Has anyone ever heard of a rowset position cannot be
restarted error?
What could possibly cause this?
When I run the query in Access it works just fine so I
know my parameters are correct. Any help would be great.
What could possibly cause this?
When I run the query in Access it works just fine so I
know my parameters are correct. Any help would be great.
Could you post your code please?
Thanks,
Val
Quote:>-----Original Message-----
>Has anyone ever heard of a rowset position cannot be
>restarted error?
>What could possibly cause this?
>When I run the query in Access it works just fine so I
>know my parameters are correct. Any help would be great.
>.
Public Function AmountData(dblCRAmount As Double,
dblCRFrom As Double, dblCRTo As Double)
'create and set the mg class object
Dim mMg As clsMakeGrid
Set mMg = New clsMakeGrid
' 'Prepare database objects
Dim cmdComnd As ADODB.Command
Dim mRs As ADODB.Recordset
' create new objects
Set mRs = New Recordset
Set cmdComnd = New Command
mRs.LockType = adLockOptimistic
mRs.CursorLocation = adUseServer
mRs.CursorType = adOpenKeyset
With cmdComnd
.ActiveConnection = gCn
.CommandText = "qryAmount"
' set the command type to be a stored procedure
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("Amt", adDouble,
adParamInput, , dblCRAmount)
.Parameters.Append .CreateParameter("dblCRFrom",
adDouble, adParamInput, , dblCRFrom)
.Parameters.Append .CreateParameter("dblCRTo", adDouble,
adParamInput, , dblCRTo)
End With
'run the query
mRs.Open cmdComnd
'If the database is at the end move to first record
If mRs.EOF Then
mRs.MoveFirst (IT IS AT THIS POINT IT BOMBS)
End If
'assign the field from the database to the appropriate _
'text boxes on the form
txtCheckNo.Text = mRs.Fields("CHECK_NO") & ""
txtAmount.Text = mRs.Fields("AMOUNT") & ""
txtCheckType.Text = mRs.Fields("CHECKTYPE") & ""
txtAccountNo.Text = mRs.Fields("ACCOUNT") & ""
mskTime.Text = mRs.Fields("TIME") & ""
mskIDate.Text = mRs.Fields("SDATE") & ""
mskCDate.Text = mRs.Fields("EDATE") & ""
txtRCheckNo.Text = mRs.Fields("RCHECK_NO") & ""
txtSeqNo.Text = mRs.Fields("SEQUENCE") & ""
txtVoid.Text = mRs.Fields("VOID") & ""
txtStopPayDate.Text = mRs.Fields("SPDATE") & ""
txtLoc.Text = mRs.Fields("LOCATION") & ""
txtTellerNo.Text = mRs.Fields("TELLER_NO") & ""
txtTellerName.Text = mRs.Fields("TELLER") & ""
txtStop.Text = mRs.Fields("STOP") & ""
'call the module to make the MS flex Grid on the
duplicates _
'tab. The object calls the function that creates the _
'rows and columns.
mMg.MakeGrid
'
''
''populate the grid until the recordset is at the end.
Do Until mRs.EOF
MSFlexGrid.AddItem vbTab & mRs.Fields
("CHECK_NO") & _
vbTab & mRs.Fields("CHECKTYPE") & _
vbTab & mRs.Fields("ACCOUNT") & _
vbTab & mRs.Fields("AMOUNT") & _
vbTab & mRs.Fields("TIME") & _
vbTab & mRs.Fields("SDATE") & _
vbTab & mRs.Fields("EDATE") & _
vbTab & mRs.Fields("RCHECK_NO") & _
vbTab & mRs.Fields("SEQUENCE") & _
vbTab & mRs.Fields("VOID") & _
vbTab & mRs.Fields("SPDATE") & _
vbTab & mRs.Fields("LOCATION") & _
vbTab & mRs.Fields("TELLER_NO") & _
vbTab & mRs.Fields("TELLER") & _
vbTab & mRs.Fields("STOP")
mRs.MoveNext
Loop
'close recordset connection
mRs.Close
'set recordset to nothing to release resourses
Set mRs = Nothing
Set cmdComnd = Nothing
'Display form name back on the window
frmNewArch.Caption = "Archived Checks"
End Function
Quote:>-----Original Message-----
>Hi,
>Could you post your code please?
>Thanks,
>Val
>>-----Original Message-----
>>Has anyone ever heard of a rowset position cannot be
>>restarted error?
>>What could possibly cause this?
>>When I run the query in Access it works just fine so I
>>know my parameters are correct. Any help would be great.
>>.
>.
If you can open recordset and get error when you try to
use MoveNext, then probably your recordset was opened as
forward-only. Try to open recordset on client side to
avoid it. Try to set CursorLocation of recordset to
adUseClient and check properties of recordset after you
open it
Val
Quote:>-----Original Message-----
>Sorry about that:
>(the parameters are being loaded properly, but it doesn't
>return a result table)
>Public Function AmountData(dblCRAmount As Double,
>dblCRFrom As Double, dblCRTo As Double)
>'create and set the mg class object
> Dim mMg As clsMakeGrid
> Set mMg = New clsMakeGrid
>' 'Prepare database objects
> Dim cmdComnd As ADODB.Command
> Dim mRs As ADODB.Recordset
>' create new objects
>Set mRs = New Recordset
>Set cmdComnd = New Command
> mRs.LockType = adLockOptimistic
> mRs.CursorLocation = adUseServer
> mRs.CursorType = adOpenKeyset
>With cmdComnd
> .ActiveConnection = gCn
> .CommandText = "qryAmount"
> ' set the command type to be a stored procedure
> .CommandType = adCmdStoredProc
> .Parameters.Append .CreateParameter("Amt", adDouble,
>adParamInput, , dblCRAmount)
> .Parameters.Append .CreateParameter("dblCRFrom",
>adDouble, adParamInput, , dblCRFrom)
> .Parameters.Append .CreateParameter("dblCRTo",
adDouble,
>adParamInput, , dblCRTo)
>End With
>'run the query
>mRs.Open cmdComnd
>'If the database is at the end move to first record
> If mRs.EOF Then
> mRs.MoveFirst (IT IS AT THIS POINT IT BOMBS)
> End If
>'assign the field from the database to the appropriate _
>'text boxes on the form
> txtCheckNo.Text = mRs.Fields("CHECK_NO") & ""
> txtAmount.Text = mRs.Fields("AMOUNT") & ""
> txtCheckType.Text = mRs.Fields("CHECKTYPE") & ""
> txtAccountNo.Text = mRs.Fields("ACCOUNT") & ""
> mskTime.Text = mRs.Fields("TIME") & ""
> mskIDate.Text = mRs.Fields("SDATE") & ""
> mskCDate.Text = mRs.Fields("EDATE") & ""
> txtRCheckNo.Text = mRs.Fields("RCHECK_NO") & ""
> txtSeqNo.Text = mRs.Fields("SEQUENCE") & ""
> txtVoid.Text = mRs.Fields("VOID") & ""
> txtStopPayDate.Text = mRs.Fields("SPDATE") & ""
> txtLoc.Text = mRs.Fields("LOCATION") & ""
> txtTellerNo.Text = mRs.Fields("TELLER_NO") & ""
> txtTellerName.Text = mRs.Fields("TELLER") & ""
> txtStop.Text = mRs.Fields("STOP") & ""
> 'call the module to make the MS flex Grid on the
>duplicates _
>'tab. The object calls the function that creates the _
>'rows and columns.
> mMg.MakeGrid
>'
>''
>''populate the grid until the recordset is at the end.
> Do Until mRs.EOF
> MSFlexGrid.AddItem vbTab & mRs.Fields
>("CHECK_NO") & _
> vbTab & mRs.Fields("CHECKTYPE") & _
> vbTab & mRs.Fields("ACCOUNT") & _
> vbTab & mRs.Fields("AMOUNT") & _
> vbTab & mRs.Fields("TIME") & _
> vbTab & mRs.Fields("SDATE") & _
> vbTab & mRs.Fields("EDATE") & _
> vbTab & mRs.Fields("RCHECK_NO") & _
> vbTab & mRs.Fields("SEQUENCE") & _
> vbTab & mRs.Fields("VOID") & _
> vbTab & mRs.Fields("SPDATE") & _
> vbTab & mRs.Fields("LOCATION") & _
> vbTab & mRs.Fields("TELLER_NO") & _
> vbTab & mRs.Fields("TELLER") & _
> vbTab & mRs.Fields("STOP")
> mRs.MoveNext
> Loop
>'close recordset connection
> mRs.Close
>{ w ? Oy !Df? <
> ? 'set recordset to nothing to release resourses
> Set mRs = Nothing
> Set cmdComnd = Nothing
>'Display form name back on the window
> frmNewArch.Caption = "Archived Checks"
>End Function
>>-----Original Message-----
>>Hi,
>>Could you pos
After running through my debug I noticed the reason I am
getting this error like that is becuase in my with
statement is says object variable or with block variable
not set. This would be a good clue to why there is not
record set.
I am referecing the Microsoft ActiveX dataobject library
that is the proper one right? The Command object is not
being set for some reason?
Quote:>-----Original Message-----
>Hi,
>If you can open recordset and get error when you try to
>use MoveNext, then probably your recordset was opened as
>forward-only. Try to open recordset on client side to
>avoid it. Try to set CursorLocation of recordset to
>adUseClient and check properties of recordset after you
>open it
>Val
>>-----Original Message-----
>>Sorry about that:
>>(the parameters are being loaded properly, but it
doesn't
>>return a result table)
>>Public Function AmountData(dblCRAmount As Double,
>>dblCRFrom As Double, dblCRTo As Double)
>>'create and set the mg class object
>> Dim mMg As clsMakeGrid
>> Set mMg = New clsMakeGrid
>>' 'Prepare database objects
>> Dim cmdComnd As ADODB.Command
>> Dim mRs As ADODB.Recordset
>>' create new objects
>>Set mRs = New Recordset
>>Set cmdComnd = New Command
>> mRs.LockType = adLockOptimistic
>> mRs.CursorLocation = adUseServer
>> mRs.CursorType = adOpenKeyset
>>With cmdComnd
>> .ActiveConnection = gCn
>> .CommandText = "qryAmount"
>> ' set the command type to be a stored procedure
>> .CommandType = adCmdStoredProc
>> .Parameters.Append .CreateParameter("Amt", adDouble,
>>adParamInput, , dblCRAmount)
>> .Parameters.Append .CreateParameter("dblCRFrom",
>>adDouble, adParamInput, , dblCRFrom)
>> .Parameters.Append .CreateParameter("dblCRTo",
>adDouble,
>>adParamInput, , dblCRTo)
>>End With
>>'run the query
>>mRs.Open cmdComnd
>>'If the database is at the end move to first record
>> If mRs.EOF Then
>> mRs.MoveFirst (IT IS AT THIS POINT IT BOMBS)
>> End If
>>'assign the field from the database to the appropriate _
>>'text boxes on the form
>> txtCheckNo.Text = mRs.Fields("CHECK_NO") & ""
>> txtAmount.Text = mRs.Fields("AMOUNT") & ""
>> txtCheckType.Text = mRs.Fields("CHECKTYPE") & ""
>> txtAccountNo.Text = mRs.Fields("ACCOUNT") & ""
>> mskTime.Text = mRs.Fields("TIME") & ""
>> mskIDate.Text = mRs.Fields("SDATE") & ""
>> mskCDate.Text = mRs.Fields("EDATE") & ""
>> txtRCheckNo.Text = mRs.Fields("RCHECK_NO") & ""
>> txtSeqNo.Text = mRs.Fields("SEQUENCE") & ""
>> txtVoid.Text = mRs.Fields("VOID") & ""
>> txtStopPayDate.Text = mRs.Fields("SPDATE") & ""
>> txtLoc.Text = mRs.Fields("LOCATION") & ""
>> txtTellerNo.Text = mRs.Fields("TELLER_NO") & ""
>> txtTellerName.Text = mRs.Fields("TELLER") & ""
>> txtStop.Text = mRs.Fields("STOP") & ""
>> 'call the module to make the MS flex Grid on the
>>duplicates _
>>'tab. The object calls the function that creates the _
>>'rows and columns.
>> mMg.MakeGrid
>>'
>>''
>>''populate the grid until the recordset is at the end.
>> Do Until mRs.EOF
>> MSFlexGrid.AddItem vbTab & mRs.Fields
>>("CHECK_NO") & _
>> vbTab & mRs.Fields("CHECKTYPE") & _
>> vbTab & mRs.Fields("ACCOUNT") & _
>> vbTab & mRs.Fields("AMOUNT") & _
>> vbTab & mRs.Fields("TIME") & _
>> vbTab & mRs.Fi{ w 2 O 0|? elds
("SDATE") & _
>> vbTab & mRs.Fields("EDATE") & _
>> vbTab & mRs.Fields("RCHECK_NO") & _
>> vbTab & mRs.Fields("SEQUENCE") & _
>> vbTab & mRs.Fields("VOID") & _
>> vbTab & mRs.Fields("SPDATE") & _
>> vbTab & mRs.Fields("LOCATION") & _
>> vbTab & mRs.Fields("TELLER_NO") & _
>> vbTab & mRs.Fields("TELLER") & _
>> vbTab & mRs.Fields("STOP")
>> mRs.MoveNext
>> Loop
>>'close recordset connection
>> mRs.Close
>>{ w ? Oy !Df? <
>> ? 'set recordset to nothing to release resourses
>> Set mRs = Nothing
>> Set cmdComnd = Nothing
>>'Display form name back on the window
>> frmNewArch.Caption = "Archived Checks"
>>End Function
>>>-----Original Message-----
>>>Hi,
>>>Could you pos
>.
I did not run your code, but it looks fine. Sounds strange
Val
Quote:>-----Original Message-----
>Thanks for the help.
>After running through my debug I noticed the reason I am
>getting this error like that is becuase in my with
>statement is says object variable or with block variable
>not set. This would be a good clue to why there is not
>record set.
>I am referecing the Microsoft ActiveX dataobject library
>that is the proper one right? The Command object is not
>being set for some reason?
>>-----Original Message-----
>>Hi,
>>If you can open recordset and get error when you try to
>>use MoveNext, then probably your recordset was opened as
>>forward-only. Try to open recordset on client side to
>>avoid it. Try to set CursorLocation of recordset to
>>adUseClient and check properties of recordset after you
>>open it
>>Val
>>>-----Original Message-----
>>>Sorry about that:
>>>(the parameters are being loaded properly, but it
>doesn't
>>>return a result table)
>>>Public Function AmountData(dblCRAmount As Double,
>>>dblCRFrom As Double, dblCRTo As Double)
>>>'create and set the mg class object
>>> Dim mMg As clsMakeGrid
>>> Set mMg = New clsMakeGrid
>>>' 'Prepare database objects
>>> Dim cmdComnd As ADODB.Command
>>> Dim mRs As ADODB.Recordset
>>>' create new objects
>>>Set mRs = New Recordset
>>>Set cmdComnd = New Command
>>> mRs.LockType = adLockOptimistic
>>> mRs.CursorLocation = adUseServer
>>> mRs.CursorType = adOpenKeyset
>>>With cmdComnd
>>> .ActiveConnection = gCn
>>> .CommandText = "qryAmount"
>>> ' set the command type to be a stored procedure
>>> .CommandType = adCmdStoredProc
>>> .Parameters.Append .CreateParameter("Amt", adDouble,
>>>adParamInput, , dblCRAmount)
>>> .Parameters.Append .CreateParameter("dblCRFrom",
>>>adDouble, adParamInput, , dblCRFrom)
>>> .Parameters.Append .CreateParameter("dblCRTo",
>>adDouble,
>>>adParamInput, , dblCRTo)
>>>End With
>>>'run the query
>>>mRs.Open cmdComnd
>>>'If the database is at the end move to first record
>>> If mRs.EOF Then
>>> mRs.MoveFirst (IT IS AT THIS POINT IT BOMBS)
>>> End If
>>>'assign the field from the database to the appropriate _
>>>'text boxes on the form
>>> txtCheckNo.Text = mRs.Fields("CHECK_NO") & ""
>>> txtAmount.Text = mRs.Fields("AMOUNT") & ""
>>> txtCheckType.Text = mRs.Fields("CHECKTYPE") & ""
>>> txtAccountNo.Text = mRs.Fields("ACCOUNT") & ""
>>> mskTime.Text = mRs.Fields("TIME") & ""
>>> mskIDate.Text = mRs.Fields("SDATE") & ""
>>> mskCDate.Text = mRs.Fields("EDATE") & ""
>>> txtRCheckNo.Text = mRs.Fields("RCHECK_NO") & ""
>>> txtSeqNo.Text = mRs.Fields("SEQUENCE") & ""
>>> txtVoid.Text = mRs.Fields("VOID") & ""
>>> txtStopPayDate.Text = mRs.Fields("SPDATE") & ""
>>> txtLoc.Text = mRs.Fields("LOCATION") & ""
>>> txtTellerNo.Text = mRs.Fields("TELLER_NO") & ""
>>> txtTellerName.Text = mRs.Fields("TELLER") & ""
>>> txtStop.Text = mRs.Fields("STOP") & ""
>>> 'call the mo{ w ? ?} T"?
>?5B/ dule to make the MS flex Grid on the
>>>duplicates _
>>>'tab. The object calls the function that creates the _
>>>'rows and columns.
>>> mMg.MakeGrid
>>>'
>>>''
>>>''populate the grid until the recordset is at the end.
>>> Do Until mRs.EOF
{ w TW !4- !"R7Quote:>-----Original Message-----
>Hi,
>I did not run your code, but it looks fine. Sounds strange
>Val
>>-----Original Message-----
>>Thanks for the help.
>>After running through my debug I noticed the reason I am
>>getting this error like that is becuase in my with
>>statement is says object variable or with block variable
>>not set. This would be a good clue to why there is not
>>record set.
>>I am referecing the Microsoft ActiveX dataobject library
>>that is the proper one right? The Command object is not
>>being set for some reason?
>>>-----Original Message-----
>>>Hi,
>>>If you can open recordset and get error when you try to
>>>use MoveNext, then probably your recordset was opened
as
>>>forward-only. Try to open recordset on client side to
>>>avoid it. Try to set CursorLocation of recordset to
>>>adUseClient and check properties of recordset after you
>>>open it
>>>Val
>>>>-----Original Message-----
>>>>Sorry about that:
>>>>(the parameters are being loaded properly, but it
>>doesn't
>>>>return a result table)
>>>>Public Function AmountData(dblCRAmount As Double,
>>>>dblCRFrom As Double, dblCRTo As Double)
>>>>'create and set the mg class object
>>>> Dim mMg As clsMakeGrid
>>>> Set mMg = New clsMakeGrid
>>>>' 'Prepare database objects
>>>> Dim cmdComnd As ADODB.Command
>>>> Dim mRs As ADODB.Recordset
>>>>' create new objects
>>>>Set mRs = New Recordset
>>>>Set cmdComnd = New Command
>>>> mRs.LockType = adLockOptimistic
>>>> mRs.CursorLocation = adUseServer
>>>> mRs.CursorType = adOpenKeyset
>>>>With cmdComnd
>>>> .ActiveConnection = gCn
>>>> .CommandText = "qryAmount"
>>>> ' set the command type to be a stored procedure
>>>> .CommandType = adCmdStoredProc
>>>> .Parameters.Append .CreateParameter("Amt", adDouble,
>>>>adParamInput, , dblCRAmount)
>>>> .Parameters.Append .CreateParameter("dblCRFrom",
>>>>adDouble, adParamInput, , dblCRFrom)
>>>> .Parameters.Append .CreateParameter("dblCRTo",
>>>adDouble,
>>>>adParamInput, , dblCRTo)
>>>>End With
>>>>'run the query
>>>>mRs.Open cmdComnd
>>>>'If the database is at the end move to first record
>>>> If mRs.EOF Then
>>>> mRs.MoveFirst (IT IS AT THIS POINT IT BOMBS)
>>>> End If
>>>>'assign the field from the database to the appropriate
_
>>>>'text boxes on the form
>>>> txtCheckNo.Text = mRs.Fields("CHECK_NO") & ""
>>>> txtAmount.Text = mRs.Fields("AMOUNT") & ""
>>>> txtCheckType.Text = mRs.Fields("CHECKTYPE")
& ""
>>>> txtAccountNo.Text = mRs.Fields("ACCOUNT") & ""
>>>> mskTime.Text = mRs.Fields("TIME") & ""
>>>> mskIDate.Text = mRs.Fields("SDATE") & ""
>>>> mskCDate.Text = mRs.Fields("EDATE") & ""
>>>> txtRCheckNo.Text = mRs.Fields("RCHECK_NO") & ""
>>>> txtSeqNo.Text = mRs.Fields("SEQUENCE") & ""
>>>> txtVoid.Text = mRs.Fields("VOID") & ""
>>>> txtStopPayDate.Text = mRs.Fields("SPDATE") & "
Quote:> O "
>>>> txtLoc.Text = mRs.Fields("LOCATION") & ""
>>>> txtTellerNo.Text = mRs.Fields("TELLER_NO") & ""
>>>> txtTellerName.Text = mRs.Fields("TELLER") & ""
>>>> txtStop.Text = mRs.Fields("STOP") & ""
>>>> 'call the mo{ w ? =
Hope this will help.
Quote:> Sorry about that:
> (the parameters are being loaded properly, but it doesn't
> return a result table)
> Public Function AmountData(dblCRAmount As Double,
> dblCRFrom As Double, dblCRTo As Double)
> 'create and set the mg class object
> Dim mMg As clsMakeGrid
> Set mMg = New clsMakeGrid
> ' 'Prepare database objects
> Dim cmdComnd As ADODB.Command
> Dim mRs As ADODB.Recordset
> ' create new objects
> Set mRs = New Recordset
> Set cmdComnd = New Command
> mRs.LockType = adLockOptimistic
> mRs.CursorLocation = adUseServer
> mRs.CursorType = adOpenKeyset
> With cmdComnd
> .ActiveConnection = gCn
> .CommandText = "qryAmount"
> ' set the command type to be a stored procedure
> .CommandType = adCmdStoredProc
> .Parameters.Append .CreateParameter("Amt", adDouble,
> adParamInput, , dblCRAmount)
> .Parameters.Append .CreateParameter("dblCRFrom",
> adDouble, adParamInput, , dblCRFrom)
> .Parameters.Append .CreateParameter("dblCRTo", adDouble,
> adParamInput, , dblCRTo)
> End With
> 'run the query
> mRs.Open cmdComnd
> 'If the database is at the end move to first record
> If mRs.EOF Then
> mRs.MoveFirst (IT IS AT THIS POINT IT BOMBS)
> End If
> 'assign the field from the database to the appropriate _
> 'text boxes on the form
> txtCheckNo.Text = mRs.Fields("CHECK_NO") & ""
> txtAmount.Text = mRs.Fields("AMOUNT") & ""
> txtCheckType.Text = mRs.Fields("CHECKTYPE") & ""
> txtAccountNo.Text = mRs.Fields("ACCOUNT") & ""
> mskTime.Text = mRs.Fields("TIME") & ""
> mskIDate.Text = mRs.Fields("SDATE") & ""
> mskCDate.Text = mRs.Fields("EDATE") & ""
> txtRCheckNo.Text = mRs.Fields("RCHECK_NO") & ""
> txtSeqNo.Text = mRs.Fields("SEQUENCE") & ""
> txtVoid.Text = mRs.Fields("VOID") & ""
> txtStopPayDate.Text = mRs.Fields("SPDATE") & ""
> txtLoc.Text = mRs.Fields("LOCATION") & ""
> txtTellerNo.Text = mRs.Fields("TELLER_NO") & ""
> txtTellerName.Text = mRs.Fields("TELLER") & ""
> txtStop.Text = mRs.Fields("STOP") & ""
> 'call the module to make the MS flex Grid on the
> duplicates _
> 'tab. The object calls the function that creates the _
> 'rows and columns.
> mMg.MakeGrid
> '
> ''
> ''populate the grid until the recordset is at the end.
> Do Until mRs.EOF
> MSFlexGrid.AddItem vbTab & mRs.Fields
> ("CHECK_NO") & _
> vbTab & mRs.Fields("CHECKTYPE") & _
> vbTab & mRs.Fields("ACCOUNT") & _
> vbTab & mRs.Fields("AMOUNT") & _
> vbTab & mRs.Fields("TIME") & _
> vbTab & mRs.Fields("SDATE") & _
> vbTab & mRs.Fields("EDATE") & _
> vbTab & mRs.Fields("RCHECK_NO") & _
> vbTab & mRs.Fields("SEQUENCE") & _
> vbTab & mRs.Fields("VOID") & _
> vbTab & mRs.Fields("SPDATE") & _
> vbTab & mRs.Fields("LOCATION") & _
> vbTab & mRs.Fields("TELLER_NO") & _
> vbTab & mRs.Fields("TELLER") & _
> vbTab & mRs.Fields("STOP")
> mRs.MoveNext
> Loop
> 'close recordset connection
> mRs.Close
> 'set recordset to nothing to release resourses
> Set mRs = Nothing
> Set cmdComnd = Nothing
> 'Display form name back on the window
> frmNewArch.Caption = "Archived Checks"
> End Function
> >-----Original Message-----
> >Hi,
> >Could you post your code please?
> >Thanks,
> >Val
> >>-----Original Message-----
> >>Has anyone ever heard of a rowset position cannot be
> >>restarted error?
> >>What could possibly cause this?
> >>When I run the query in Access it works just fine so I
> >>know my parameters are correct. Any help would be great.
> >>.
> >.
Thanks for the reply. It does come back as an empty table,
but the strange thing is that when I run the query in
Access it is just fine.
you can't move to theQuote:>-----Original Message-----
>Ofcourse you will fail at that point, when mRs.EOF is
true at this point,
>that means database return is an empty recordset, then
>Hope this will help.
>> Sorry about that:
>> (the parameters are being loaded properly, but it
doesn't
>> return a result table)
>> Public Function AmountData(dblCRAmount As Double,
>> dblCRFrom As Double, dblCRTo As Double)
>> 'create and set the mg class object
>> Dim mMg As clsMakeGrid
>> Set mMg = New clsMakeGrid
>> ' 'Prepare database objects
>> Dim cmdComnd As ADODB.Command
>> Dim mRs As ADODB.Recordset
>> ' create new objects
>> Set mRs = New Recordset
>> Set cmdComnd = New Command
>> mRs.LockType = adLockOptimistic
>> mRs.CursorLocation = adUseServer
>> mRs.CursorType = adOpenKeyset
>> With cmdComnd
>> .ActiveConnection = gCn
>> .CommandText = "qryAmount"
>> ' set the command type to be a stored procedure
>> .CommandType = adCmdStoredProc
>> .Parameters.Append .CreateParameter("Amt", adDouble,
>> adParamInput, , dblCRAmount)
>> .Parameters.Append .CreateParameter("dblCRFrom",
>> adDouble, adParamInput, , dblCRFrom)
>> .Parameters.Append .CreateParameter("dblCRTo",
adDouble,
>> adParamInput, , dblCRTo)
>> End With
>> 'run the query
>> mRs.Open cmdComnd
>> 'If the database is at the end move to first record
>> If mRs.EOF Then
>> mRs.MoveFirst (IT IS AT THIS POINT IT BOMBS)
>> End If
>> 'assign the field from the database to the appropriate _
>> 'text boxes on the form
>> txtCheckNo.Text = mRs.Fields("CHECK_NO") & ""
>> txtAmount.Text = mRs.Fields("AMOUNT") & ""
>> txtCheckType.Text = mRs.Fields("CHECKTYPE") & ""
>> txtAccountNo.Text = mRs.Fields("ACCOUNT") & ""
>> mskTime.Text = mRs.Fields("TIME") & ""
>> mskIDate.Text = mRs.Fields("SDATE") & ""
>> mskCDate.Text = mRs.Fields("EDATE") & ""
>> txtRCheckNo.Text = mRs.Fields("RCHECK_NO") & ""
>> txtSeqNo.Text = mRs.Fields("SEQUENCE") & ""
>> txtVoid.Text = mRs.Fields("VOID") & ""
>> txtStopPayDate.Text = mRs.Fields("SPDATE") & ""
>> txtLoc.Text = mRs.Fields("LOCATION") & ""
>> txtTellerNo.Text = mRs.Fields("TELLER_NO") & ""
>> txtTellerName.Text = mRs.Fields("TELLER") & ""
>> txtStop.Text = mRs.Fields("STOP") & ""
>> 'call the module to make the MS flex Grid on the
>> duplicates _
>> 'tab. The object calls the function that creates the _
>> 'rows and columns.
>> mMg.MakeGrid
>> '
>> ''
>> ''populate the grid until the recordset is at the end.
>> Do Until mRs.EOF
>> MSFlexGrid.AddItem vbTab & mRs.Fields
>> ("CHECK_NO") & _
>> vbTab & mRs.Fields("CHECKTYPE") & _
>> vbTab & mRs.Fields("ACCOUNT") & _
>> vbTab & mRs.Fields("AMOUNT") & _
>> vbTab & mRs.Fields("TIME") & _
>> vbTab & mRs.Fields("SDATE") & _
>> vbTab & mRs.Fields("EDATE") & _
>> vbTab & mRs.Fields("RCHECK_NO") & _
>> vb{ w z pE ,mU3y
>?Tab & mRs.Fields("SEQUENCE") & _
>> vbTab & mRs.Fields("VOID") & _
>> vbTab & mRs.Fields("SPDATE") & _
>> vbTab & mRs.Fields("LOCATION") & _
>> vbTab & mRs.Fields("TELLER_NO") & _
>> vbTab & mRs.Fiel
1. Rowset position cannot be restarted
Hi, I'm creating an Active Server Page using ADO to connect to SQL. Once I
bring in my data, I'm doing a While loop (vbscript). Within that loop, when
I attempt to either set a filter on the records or if I try to use
MoveFirst, it gives me the following error:
Microsoft OLE DB Provider for SQL Server error '80040e18' Rowset position
cannot be restarted. I am using adOpenStatic to return data from my stored
procedure.
My temporary workaround is to keep requerying the data to go to the first
record, which is a really inefficient.
Has anyone seen this error? I've been doing research on this one for quite
a while with no luck.
Thanks,
Pam
3. C++:Rowset position cannot be restarted
4. any book is available in msia
5. INFORMIX
6. C++:Rowset position cannot be restarted.
7. Stored Procedure Versioning
8. How to avoid ERROR: "Rowset position cannot be restarted."????
9. Positioned Updates/Adds in a rowset
11. add a column at a specific position in the table or alter a columns position