borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (List of active tasks in Win98)Next Topic (Create Program Shortcuts W/O API) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Runtime Error: 3704
Poster Message
boye-i
Level: Scholar

Registered: 22-10-2002
Posts: 43

icon Runtime Error: 3704

Hi,
Whenever I run the following code I recieve the following message:

"Runtime Error: 3704 The Operation requested by the application is not allowed if the object is closed."

at the .AddNew line. This is how the code flows:

General Declaration()
Dim mrstBalanceSheet As Recordset
Dim cn As ADODB.Connection
----------------------
Form_Load()
Set mrstBalanceSheet = New Recordset
cn.ConnectionString = "dsn=cmis"
cn.Open
--------------------------
Command1_Click()
Set mrstBalanceSheet = cn.Execute("Delete * from BalanceSheet")

'Preparing For The Balance Sheet Table
    'INCOME
    k = 0
    With rstBalanceSheet
       For i = 0 To ctrT -1                
        If AccountCartegory(i) = "INCOME" Then
             .AddNew
              !AccountTypeI = AccountType(i)
              !AmountI = AccountTotal(i)
             .Update
         End If
       Next i
     End With

How do I solve this please?

____________________________
IKBoye

02-12-2002 at 07:57 AM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1616
icon Re: Runtime Error: 3704

you need a:
mrstBalanceSheet.Open "tablename" ' and the other parameters

[after the: Set mrstBalanceSheet = cn.Execute("Delete * from BalanceSheet")]

[Edited by JLRodgers on 02-12-2002 at 07:36 PM GMT]

02-12-2002 at 06:03 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
boye-i
Level: Scholar

Registered: 22-10-2002
Posts: 43
icon Re: Runtime Error: 3704

Hi JLRodgers,
A lot of thanks for your support. U are an angel to me.

Regards.

____________________________
IKBoye

03-12-2002 at 02:27 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Runtime Error: 3704
Previous Topic (List of active tasks in Win98)Next Topic (Create Program Shortcuts W/O API) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder