Results 1 to 3 of 3

Thread: Data Environment

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Seattle
    Posts
    954
    I have a data environment (dataenvironmet1) that runs a sql query and posts the results to a data grid. My question is after that query has been ran (command1) how do you close the connection? For example, if I run the query and get the results and then try to run another query it will give me the message


    Run Time error 3705
    "Operation is not allowed when object is open"

    I am supposing that all I have to do is close the connection. I understand how to do when using ADO but I have no clue with a dataenvironment.

    Thanks

  2. #2
    Hyperactive Member crosbj's Avatar
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    285
    'PRINT SHIFT REPORTS
    With DE1 ' MY DATA ENVIRONMENT

    'CLOSE CONNECTION
    If .rsdrFindPayroll.State = adStateOpen Then
    .rsdrFindPayroll.Close
    End If

    'SET QUERY PARAMETER
    MSHFlexGrid1.LeftCol = 0

    'OPEN CONNECTION
    .drFindPayroll MSHFlexGrid1.Text

    'SHOW PAYROLL REPORT
    drPayroll.PrintReport

    End With

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Seattle
    Posts
    954
    Thanks!

Posting Permissions

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



Click Here to Expand Forum to Full Width