Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2007
    Posts
    2

    Unanswered: DataEnvironment1

    Hi there.

    I built the following code to run a report:
    Private Sub cmdTest_Click()
    If Not IsNull(txtDateFrom) Or (txtDateFrom <> "") Then
    DataEnvironment1.Command2 txtDateFrom.Text
    DataReport2.Show
    End If
    End Sub
    When I run it displays the report strait away but if I try to run another report it gives a Run-time error '3705' saying: Operation not allowed when the objects is open.

    If after or before the line saying dataReport2.Show I insert the following line: DataEnvironment1.rsCommand2.Close I get another error saying: Prepared statment '(@P1 nvarchar(50))SELECT tblP.switchname, tblN.NNI, tblB' expects parameter @P1, which was not suplied.

    Is there anyone that could tell me what I'm doing wrong or tell me the steps to run a report?

    Thanks

  2. #2
    Join Date
    May 2006
    Posts
    18
    Hi,

    >Is there anyone that could tell me what I'm doing wrong.

    Using DataEnvironment (which is an atractive thing at a first glance but in reality just introduces problems and limits the flexibility of you application)
    Please open your connection and recordset (rs) 'in code'

    To bind your recordset to the Datareport use its .DataSource property.

    Regards,
    Shurik.

Posting Permissions

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