Results 1 to 6 of 6

Thread: Operation is not allowed when object is open

  1. #1
    New Member
    Join Date
    Mar 11
    Posts
    4

    Operation is not allowed when object is open

    hai,
    I have a problem with my vb code,displaying run time error 3705,"Operation is not allowed when object is open".How to solve this problem.i am using MS access as backend.

    Private Sub Command1_Click()
    DE1.combine (txtLabNo.Text)
    DataReport2.Show
    End Sub
    error is displayed in line 2.

    actually the project is developed for a lab.I want to generate a data report based on the parameter.For this i add a new comand to the connection property of data environment.and in the command properties,on the sql builder section i add the following
    SELECT T1.*, T2.* FROM patient_entry T1, combine_result T2 WHERE T1.trc_lab_no = ?

    this is to combine the records of two tables and make them as one single data report.

    so please advise....

  2. #2
    Unmoderated abhijit's Avatar
    Join Date
    Jun 99
    Location
    Chit Chat Forum.
    Posts
    3,117

    Re: Operation is not allowed when object is open

    Check for your connection. Are you trying to re-open the connection?


    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text File

  3. #3
    Lively Member
    Join Date
    Dec 10
    Posts
    105

    Re: Operation is not allowed when object is open

    hi, post your code so we can have a look

  4. #4
    Addicted Member Mehmood Iqbal's Avatar
    Join Date
    Mar 11
    Location
    Chakwal, Pakistan
    Posts
    150

    Re: Operation is not allowed when object is open

    You are trying to connect with 2 object at the same time without closing connection with previous one.

    DE1.combine (txtLabNo.Text) 'txtLabNo
    DataReport2.Show 'Datareport

    Try to connect one object at the same time.

  5. #5
    New Member
    Join Date
    Aug 99
    Location
    bangalore, Karnataka, India
    Posts
    1

    Re: Operation is not allowed when object is open

    you need to close the connection to the dataenvironment like
    DataEnvironment1.rsCommand1.Close

    you may use another button to effect this line of code

  6. #6
    Frenzied Member
    Join Date
    Jan 09
    Location
    Watch Window(Shift+f9)
    Posts
    1,434

    Re: Operation is not allowed when object is open

    you need to check if it is open after manipulating data . you need to close the rscommand1 .try the following way .
    Code:
    
    
    DE1.combine (txtLabNo.Text) 'txtLabNo
    DataReport2.Show 'Datareport
    
    if DataEnvironment1.rsCommand1.open then 'after showing records you need to close .
       DataEnvironment1.rsCommand1.Close
    End if
    Last edited by firoz.raj; Sep 2nd, 2012 at 04:45 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •