DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: data environment command

  1. #1
    Join Date
    Apr 2006
    Posts
    47

    Unhappy data environment command

    hii guy

    SELECT * FROM administrator

    im use this command in the SQL Statement on the Command in the data environment as defaut before execute or run program...

    then in my source code or coding program....i change the command text just like below...

    Private Sub Command1_Click()
    DataEnvironment1.Commands("Command1").CommandText = "SELECT * FROM administrator WHERE a_id='1'"
    DataReport1.Show
    End Sub

    Private Sub Command2_Click()
    DataEnvironment1.Commands("Command1").CommandText = "SELECT * FROM administrator WHERE a_id='2'"
    DataReport1.Show
    End Sub

    Private Sub Command3_Click()
    DataEnvironment1.Commands("Command1").CommandText = "SELECT * FROM administrator WHERE a_id='122'"
    DataReport1.Show
    End Sub


    i run the application for first time i click button Command1 it's work...then i click Command2 and Command3 it's not change at all in the report...

    i try to use this command..while in forum i ask the user totry this coding...

    DataEnvironment1.rsCommand1.Requery @ DataEnvironment1.rsCommand1.Resync

    and this error was occur....

    Error:
    Run-time error '3704'
    Operation is not allowed when the object is closed

    then i'm tried used this command:

    DataEnvironment1.rsCommand1.Open

    then another error said that:::

    error:
    Operation is not allowed when the object is open

    Question::::

    What is the exactly happen???Can anybody tell me how to make my coding is execute succesfully refer to my coding up there...I hope u guy can help me to solve my problem????

  2. #2
    Join Date
    Feb 2006
    Posts
    133
    Hi, I'm not so familiar with datareports but these errors are recordset errors I think.

    Operation is not allowed when the object is closed
    => This error occurs when you try to execute an sql-statement or another transaction with a recordset that's closed.

    Normally:

    Code:
    dim rst as adodb.recordset
    set rst as new adodb.recordset
    rst.open "..."
    Operation is not allowed when the object is open
    This can happen when you try to open a recordset that's already open
    Benjamin

Similar Threads

  1. Save Image to Field
    By Chicho in forum VB Classic
    Replies: 11
    Last Post: 10-01-2003, 12:00 AM
  2. Replies: 1
    Last Post: 08-29-2002, 08:28 AM
  3. VB 6: Data Environment Help
    By Kelly in forum VB Classic
    Replies: 0
    Last Post: 08-19-2002, 01:25 PM
  4. Data Environment - Cache Results problem
    By BernS in forum VB Classic
    Replies: 0
    Last Post: 06-20-2002, 09:27 AM
  5. Replies: 2
    Last Post: 05-30-2000, 10:37 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center