|
-
Jun 21st, 2007, 08:00 PM
#1
Thread Starter
Addicted Member
Problem calling crystal report from vb.net
I can run the report with my vb.net from my local server but I recieve the following error when I try to call the report on another server.
Exception Details: System.Runtime.InteropServices.COMException: Logon failed. Details: IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified Error in File C:\WINDOWS\TEMP\{709522A0-E0C5-4736-852D-412200F985B6}.rpt: Unable to connect: incorrect log on parameters.
Any ideas??
-
Jun 22nd, 2007, 04:13 AM
#2
Re: Problem calling crystal report from vb.net
Hi. Show the code your are using to display the report.
"The dark side clouds everything. Impossible to see the future is."
-
Jun 22nd, 2007, 08:35 AM
#3
Thread Starter
Addicted Member
Re: Problem calling crystal report from vb.net
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
Dim newReportDocument As New ReportDocument
newReportDocument.Load("C:\Inetpub\wwwroot\projectname\report.rpt")
newReportDocument.SetDatabaseLogon("userid", "password")
CrystalReportViewer1.ReportSource = newReportDocument
CrystalReportViewer1.DataBind()
end sub
The crystal report calls a SQL stored procedure with uses a .net com object. I'm not sure if that is part of the problem. Everything works fine on my local machine, so I'm leaning towards permissions.
-
Jun 27th, 2007, 01:24 AM
#4
Junior Member
Re: Problem calling crystal report from vb.net
i have also seen that error while trying to figure out how to display my report on another server.
Did u copy ur file properly onto the server?
Do u want to try my code.?
Because i used this and the report worked. =)
Code:
Private Sub logonToDatabase()
Dim crTableLogoninfos As New TableLogOnInfos
Dim crTableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo
crTableLogoninfos = New TableLogOnInfos
crTableLogoninfo = New TableLogOnInfo
crConnectionInfo = New ConnectionInfo
With crConnectionInfo
.ServerName = "the filepath where your database is located"
.DatabaseName = "the database file name"
.UserID = "user id assigned"
.Password = "password assigned"
End With
crTableLogoninfo.ConnectionInfo = crConnectionInfo
CrystalReportViewer1.ReportSource = 'report name
End Sub
Although still not very sure how it works. Any questions you try to ask me. May be able to answer/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|