CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Posts
    20

    The data report can't be updated

    I create a data report using data environment in visual basic 6.0. The report is based on a table.But when I changed the records in the database at run time and show the report again, the report can't be updated and it shows the same records in the origianl table. Who know the solution?Thank you!


  2. #2
    Join Date
    May 1999
    Posts
    20

    Re: The data report can't be updated

    I have found the solution,you can set the datasource of the report
    in run time. In the following code,"rpt" is the name of the data report.

    Dim cn As ADODB.Connection
    Dim rs As ADODB.Recordset
    Dim sSql As String

    Dim nCtrl As Integer

    Set cn = New ADODB.Connection
    Set rs = New ADODB.Recordset
    cn.ConnectionString = gsConnection
    cn.Open

    sSql = "select * from temp"

    rs.Open sSql, cn, adOpenStatic, adLockOptimistic

    Set rpt.DataSource = rs
    rptOut.DataMember = ""
    With rpt.Sections("secDetail").Controls
    For nCtrl = 1 To .Count
    If TypeOf .Item(nCtrl) Is RptTextBox Or _
    TypeOf .Item(nCtrl) Is RptFunction Then
    .Item(nCtrl).DataMember = ""
    End If
    Next nCtrl
    End With

    rpt.Show

    rs.Close
    cn.Close
    Set rs = Nothing
    Set cn = Nothing




  3. #3
    Join Date
    Jun 1999
    Location
    Pune, Maharastra, India
    Posts
    59

    Re: The data report can't be updated

    Never used vb6 or did any reports in vb6 but had this problem in vb5 the soln there was there is an option call store report data with report we have to uncheck it and the report always queries the table for new data this was in the file menu. Try it , it may solve your problem . Please tell if it solves the problem

    Mail Id [email protected]


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

Featured