RE: Run-time Error 3704 in VB6

From: Marcus Lloyd (MarcusLloyd_at_discussions.microsoft.com)
Date: 01/29/05


Date: Sat, 29 Jan 2005 12:15:02 -0800

Hi,

I found when using vba, that if you call the recordcount, you must first
movelast. Otherwise I used to get an error.

Hope this example helps.

dim rc as integer

rst_account_data.movelast
rc = rst_account_data.recordcount

> If rst_account_data.State = 1 Then rst_account_data.Close
> cnn_DB.sp_adjust_account Me.ssn_key, rst_account_data
>
> Set rst_account_data.ActiveConnection = Nothing
> Set Me.grdBalance.DataSource = rst_account_data
>
> If rst_account_data.RecordCount > 0 Then <!-HERE IS WHERE ERROR OCCURS-!>
> rst_account_data.MoveFirst
> Do Until rst_account_data.EOF
> ...

cya

"Wildlife" wrote:

> This is a really weird occurrence I am querying a database based on users
> ID's.
>
> For some users everything goes through fine for others I get an error. I
> have verified that data is being returned for all users. I am thourghly
> confused here is the codeblock:
>
> If rst_account_data.State = 1 Then rst_account_data.Close
> cnn_DB.sp_adjust_account Me.ssn_key, rst_account_data
>
> Set rst_account_data.ActiveConnection = Nothing
> Set Me.grdBalance.DataSource = rst_account_data
>
> If rst_account_data.RecordCount > 0 Then <!-HERE IS WHERE ERROR OCCURS-!>
> rst_account_data.MoveFirst
> Do Until rst_account_data.EOF
> ...
>
>
> At this point for certain queries it reports that "the operation is not
> allowed when the object is closed."
>
> I assure you that the recordset is still open. Please Help! It was working
> fine I think until we upgraded to SQL 2000 a few months back
>



Relevant Pages

  • Re: No recordcount from a procedure
    ... If you are checking the recordcount property in ADO, ... Dim cn As New ADODB.Connection ... Dim royalty As Variant ... adParamReturnValue) ...
    (microsoft.public.sqlserver.programming)
  • RE: Reading an external text file
    ... Changing the startRow and startColumn values won't make any difference. ... Dim startRow As Integer ... Dim recordCount As Integer ... populate an excel sheet for anaylsis. ...
    (microsoft.public.excel.programming)
  • Re: Pivot Records
    ... least return first 255 if recordcount was more ... ' Northwind.mdb, for example, and you want to transpose ... Dim tdfNewDef As DAO.TableDef ... Dim rstTarget As DAO.Recordset ...
    (microsoft.public.access.queries)
  • Re: Pivot Records
    ... least return first 255 if recordcount was more ... ' Northwind.mdb, for example, and you want to transpose ... Dim tdfNewDef As DAO.TableDef ... Dim rstTarget As DAO.Recordset ...
    (microsoft.public.access.queries)
  • Re: Pivot Records
    ... least return first 255 if recordcount was more ... (plus message that did not transpose all data)... ... Dim tdfNewDef As DAO.TableDef ... Dim rstTarget As DAO.Recordset ...
    (microsoft.public.access.queries)