RE: Run-time Error 3704 in VB6
From: Marcus Lloyd (MarcusLloyd_at_discussions.microsoft.com)
Date: 01/29/05
- Next message: William \(Bill\) Vaughn: "Re: ADO Command Objects question !"
- Previous message: Ken Kazinski: "Table Not Created"
- Messages sorted by: [ date ] [ thread ]
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
>
- Next message: William \(Bill\) Vaughn: "Re: ADO Command Objects question !"
- Previous message: Ken Kazinski: "Table Not Created"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|