Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report Error

Status
Not open for further replies.

Bubsa

MIS
Mar 16, 2010
14
GB
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
 
Is the web server behind a firewall? Does it have access to the network where your database is located?

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
The web server is actaully my laptop (I am running IIS on here) so no there should be no difference from localhost and IIS as they are running of the same machine my laptop !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top