Urgent with data environment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    Urgent with data environment

    Hi all,
    I have a big problem.
    When ever i make some changes to my database the dataenvironment connected to it does not change unless i restart the programe.

    But when i refresh the dataenvironment the changes made.

    So how can i refresh dataenvironment at runtime or programatically .

    Thanx a lot.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    What do you mean by make some changes to my database ?

    Are you modifying the table structure ?

    Comment

    • muddasirmunir
      Contributor
      • Jan 2007
      • 284

      #3
      asalam o alikum

      you must give refresh evnet at inittialize evnet of datarepor to prevent
      this

      by first closing the recordset and then reopne it
      Originally posted by debasisdas
      What do you mean by make some changes to my database ?

      Are you modifying the table structure ?

      Comment

      • Ali Rizwan
        Banned
        Contributor
        • Aug 2007
        • 931

        #4
        Originally posted by debasisdas
        What do you mean by make some changes to my database ?

        Are you modifying the table structure ?
        I have adodc control in my form and i update a field.
        Now i opens datareport here no changes are made.
        this is i mean by some changes to my database.

        I know how to update a record using dataenvironment but i dont want to do so.

        now how can i refresh dataenvironment ?

        Thanx

        Comment

        • Ali Rizwan
          Banned
          Contributor
          • Aug 2007
          • 931

          #5
          Originally posted by muddasirmunir
          asalam o alikum

          you must give refresh evnet at inittialize evnet of datarepor to prevent
          this

          by first closing the recordset and then reopne it
          Assalam-o-Alaikum

          Can you please tell me the procedure by writing the code?

          Thanx

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            If you don't refresh ,how do you expect the modified data to reflect on the report.

            Comment

            • Ali Rizwan
              Banned
              Contributor
              • Aug 2007
              • 931

              #7
              Originally posted by debasisdas
              If you don't refresh ,how do you expect the modified data to reflect on the report.
              O man!
              I m just asking the code for refreshing the commands or connections in data environment or the whole dataenvironment .
              Pleaase tell me just the code for refreshing.
              My time is just the tommorrow 12 PM.
              And i want it badly.
              Thanx a lot.

              Comment

              • 9815402440
                New Member
                • Oct 2007
                • 180

                #8
                hi
                to refresh a particular command of dataenvironment use follwoing code

                With DataEnvironment 1
                .rscMD.Requery
                End With

                and to refresh the connection just close the connection and re-open it.

                remember to do all the refresh work before you refer to the data report. do not in the initialize event. because initialize event is triggered only at first call to the data report.

                i show data report following way
                With DataEnv.Connect ion1
                If .State = adStateOpen Then
                .Close
                End If
                .Open
                De.Command1 < Parameters (if any)> 'Source for Report
                End With
                report.show

                regards
                manpreet singh dhillon hoshiarpur

                Comment

                Working...