Logon failed. Details: 42000:[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database "DATA" requested by the login. The login failed. Error in File C:\Windows\TEMP\NewQuote {573CE511-64B7-4161-B9DF-0E58EB1EDA19}.rpt: Unable to connect: incorrect log on parameters.
I get the above message when loading the crystal report from the Intranet via IIS but it works fine from the localhost the report loads ok and picks up my parameters. This is my Code behind Page.
Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load
Dim Count As Int32
Count = Int32.Parse(Label1.Text)
Dim ConnInfo As New ConnectionInfo
With ConnInfo
.ServerName = "\\Server1\Sqlexpress"
.DatabaseName = "DATA"
.UserID = "sa"
.Password = "118118"
End With
Me.CrystalReportViewer1.ParameterFieldInfo.Clear()
Dim ParamFields As ParameterFields = Me.CrystalReportViewer1.ParameterFieldInfo
Dim p_EmpID As New ParameterField
p_EmpID.Name = "Pam"
Dim p_EmpID_Value As New ParameterDiscreteValue
p_EmpID_Value.Value = Count
p_EmpID.CurrentValues.Add(p_EmpID_Value)
ParamFields.Add(p_EmpID)
End Sub
I get the above message when loading the crystal report from the Intranet via IIS but it works fine from the localhost the report loads ok and picks up my parameters. This is my Code behind Page.
Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load
Dim Count As Int32
Count = Int32.Parse(Label1.Text)
Dim ConnInfo As New ConnectionInfo
With ConnInfo
.ServerName = "\\Server1\Sqlexpress"
.DatabaseName = "DATA"
.UserID = "sa"
.Password = "118118"
End With
Me.CrystalReportViewer1.ParameterFieldInfo.Clear()
Dim ParamFields As ParameterFields = Me.CrystalReportViewer1.ParameterFieldInfo
Dim p_EmpID As New ParameterField
p_EmpID.Name = "Pam"
Dim p_EmpID_Value As New ParameterDiscreteValue
p_EmpID_Value.Value = Count
p_EmpID.CurrentValues.Add(p_EmpID_Value)
ParamFields.Add(p_EmpID)
End Sub