Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    (vb) refresh data environment

    mi capita che, dopo aver aperto un report e aggiunnto dei record nel database, che quei record nuovi non vengono aggiornati quando vado a riaprire il report.....
    Come posso fre per aggiornare il data environment ??

  2. #2
    Utente di HTML.it L'avatar di darkblOOd
    Registrato dal
    Jul 2001
    Messaggi
    2,212
    DataEnvironment.Refresh?

  3. #3
    Utente di HTML.it L'avatar di Willy99
    Registrato dal
    Jan 2000
    Messaggi
    246
    Eccoti accontentato.
    Anch'io avevo lo stesso problema e lho risolto con questo.


    HOWTO: Refresh a Parameterized DataReport
    The information in this article applies to:
    Microsoft Visual Basic Professional Edition for Windows 6.0
    Microsoft Visual Basic Enterprise Edition for Windows 6.0

    This article was previously published under Q244779
    SUMMARY
    This article demonstrates basing a DataReport on a parameterized DataEnvironment and refreshing the report when the parameter value changes.
    MORE INFORMATION
    Open a new Standard EXE Project in Microsoft Visual Basic. Form1 is created by default.
    Add a DataEnvironment (DataEnvironment1) and a DataReport (DataReport1) to the project.
    Add a Connection (Connection1) to the DataEnvironment pointing to NWIND.MDB (or Northwind.MDB) through the Microsoft Jet 4.0 OLE DB Provider.
    Add a Command (Command1) to Connection1, with the following properties:

    CommandType: adCommandText
    CommandText: Select * From Employees Where HireDate < ?

    In the Parameters tab:

    Name: pDate
    Direction: Input
    Data Type: adDBTimeStamp
    Host Data Type: Date (VT_DATE)


    In the DataReport, set the following properties:

    DataSource: DataEnvironment1
    DataMember: Command1


    Drag the following fields from the DataEnvironment into the Detail section of the DataReport:

    EmployeeID
    FirstName
    LastName
    HireDate


    Add a TextBox (Text1) and a CommandButton (Command1) to the form. Add the following code:
    Option Explicit

    Private Sub Command1_Click()
    Load DataEnvironment1
    With DataEnvironment1
    If .rsCommand1.State <> 0 Then .rsCommand1.Close
    .Command1 CDate(Text1.Text)
    End With
    DataReport1.Refresh
    If DataReport1.Visible = False Then DataReport1.Show
    End Sub

    Save the project and run it. Enter the following dates in the TextBox and click the CommandButton after each one:

    1/1/95
    1/1/94
    1/1/93
    1/1/92

    You can see the report refresh showing only those employees hired prior to the date entered.



    :quote: :quote: :quote: :quote: :quote:

  4. #4
    Perfetto... grazie tante.....

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.