0

ey i have following code for crystal report 8.5 to vb6...
i just want to change database location of report from vb code...

    Private Sub Form_Load()
        Dim Reportapp As New CRAXDDRT.Application
        Dim Report As CRAXDDRT.Report
        Set Report = Reportapp.OpenReport(App.Path & "\orders.rpt")
        Report.Database.SetDataSource App.Path & "\RatanDB.mdb"
        CRViewer2.ReportSource = Report
        CRViewer2.ViewReport
        CRViewer2.Zoom (100)
    End Sub

the setdatasource is not working, its going in it's default location...
i want it to search in -->> App.path & "\RatanDB.mdb"
can any one help me, its urgent please tank you... :)

Edited by sanket044

2
Contributors
3
Replies
8
Views
4 Years
Discussion Span
Last Post by jhai_salvador
Featured Replies
  • This is what Im using on my crystal report 8.5. Reports are created and connected via odbc so database location can be easily change. Dim crxTable As CRAXDRT.DatabaseTable Dim mReport As CRAXDRT.Report For Each crxTable In mReport.Database.Tables '* Use to Connect via ODBC, '* crxTable.SetLogOnInfo(pServerName As String, [pDatabaseName], [pUserID], [pPassword]) … Read More

1

This is what Im using on my crystal report 8.5.

Reports are created and connected via odbc so database location can be easily change.

Dim crxTable As CRAXDRT.DatabaseTable
Dim mReport As CRAXDRT.Report

For Each crxTable In mReport.Database.Tables

 '* Use to Connect via ODBC,
 '* crxTable.SetLogOnInfo(pServerName As String, [pDatabaseName], [pUserID], [pPassword])

 crxTable.SetLogOnInfo "ODBCName", "db.mdb", "admin", "passwordgoeshere"
 DoEvents
Next
0

thank you buddy thank you very much, sooooooo much...... i got it...

Edited by sanket044

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.