Results 1 to 1 of 1

Thread: Crystal Report: Failed to open connection

Threaded View

  1. #1

    Thread Starter
    Fanatic Member snufse's Avatar
    Join Date
    Jul 2004
    Location
    Jupiter, FL
    Posts
    912

    Question Crystal Report: Failed to open connection

    I have an asp application that runs a Crystal Report (pull method). I dont't seem to get past error in my connection. I need the Crystal Report connect to different servers depending upon user selection. The data base and sign on are always the same.

    Here is my attempt:

    Code:
    Dim myPath As String = (Server.MapPath("PlantSalesReport.rpt"))
    
    myCrystalReport1.Load(myPath)
    
    myCrystalReport1.SetParameterValue("Ask-Date", DropDownList2.SelectedValue)
    
    CrystalReportViewer1.ReportSource = myCrystalReport1
    
    CrystalReportViewer1.Zoom(100)
    
    CrystalReportViewer1.Width = 500
    
    Dim myLogin As New ConnectionInfo
    
    myLogin.ServerName = "RG5543"
    
    myLogin.DatabaseName = "C:\Program Files\Astec Industries\WM2000\Data\WM2000DATA.add"
    
    myLogin.UserID = "xxxx"
    
    myLogin.Password = "yyyy"
    
    Dim myTables As Tables = myCrystalReport1.Database.Tables
    
    For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
    
    Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo
    
    myTableLogonInfo.ConnectionInfo = myLogin
    
    myTable.ApplyLogOnInfo(myTableLogonInfo)
    
    myTable.Location = myTable.LogOnInfo.TableName
    
    Next
    Now when I runn the app I get error:

    Failed to open the connection. Failed to open the connection. C:\WINDOWS\TEMP\PlantSalesReport {64260EE9-7818-45DC-8D07-381284D2DEB8}.rpt
    Last edited by snufse; May 13th, 2009 at 10:11 AM.

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