Results 1 to 4 of 4

Thread: Problem calling crystal report from vb.net

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    137

    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??

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    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."

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    137

    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.

  4. #4
    Junior Member Coke's Avatar
    Join Date
    Mar 2007
    Posts
    31

    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
  •  



Click Here to Expand Forum to Full Width