Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004

    Thumbs up Unanswered: Change Database and server @ runtime

    hi ,

    iam using vb6/sql server/ crystal reports 8.5.. my problem is that i want to change the server and database of the report at runtime .. how can i do this .. the server can be either the local pc or a remote server .. we donot use odbc to connect the application .. so the report should be connected without using odbc dsn .. how can i do this ..

  2. #2
    Join Date
    Mar 2004

    Lightbulb try this one but not sure

    rep.Load(Application.StartupPath & "\report\" & rptFileName)----
    you can have report source path what ever u have or report itself here....
    CrystalReportViewer1.ReportSource = rep
    CrystalReportViewer1.LogOnInfo(0).ConnectionInfo.S erverName = Application.StartupPath & "\Data\db1.MDB; Jet OLEDBatabase Password=" & DbPwd
    try this and also
    CrystalReportViewer1.LogOnInfo(0).ConnectionInfo.. .. have other properties as well like passwrod ,server name, etc.

    use this code in ur report viever form rep is reportdocument object
    crystalreportviewer1 is report viever component

    this is in
    but i think it might help you in vb6
    cuz i know nothing about vb6..
    any way have a try..
    best luck

Posting Permissions

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