Crystal Report Database Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hemant Pathak
    Recognized Expert New Member
    • Jul 2006
    • 92

    #1

    Crystal Report Database Problem

    Hi All

    i m working in vb 6.0,crystal report 8.0 then problem with me that i have many databases Like Com1001,Com1002 ,Com1003,Com100 4,Com1005 ect then i m designed a report with Com1001 but i want to change the database name at run time. all database structure is same.

    then please give me Solution ............... ..........Pleas e
  • sukeshchand
    New Member
    • Jan 2007
    • 88

    #2
    Try this

    Code:
    Set Report = Application.OpenReport(app.path & "\Reports\MaterialIndent.rpt", 1)
    Report.ParameterFields(1).AddCurrentValue UCase("Material Indent")
    Report.RecordSelectionFormula = "{MaterialIntentHdr.Docno} = '" & txtDocno & "' and {MaterialIntentHdr.Division} ='" & txtDivn & "' and {RptSettings.TransName}='Material Indent'"
    Set connProp = Report.Database.Tables.Item(1).ConnectionProperties
    connProp("DSN") = "Inventory"
    connProp("Database") = "Inventory"
    connProp("User ID") = gstrUid
    connProp("Password") = VarSQLPass
    frmRptView900.CR9Viewer.ReportSource = Report
    frmRptView900.CR9Viewer.DisplayGroupTree = False
    frmRptView900.CR9Viewer.ViewReport
    frmRptView900.Tag = Me.Tag
    frmRptView900.Show vbModal

    Comment

    Working...