Results 1 to 2 of 2

Thread: Failed login. Killing me.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    122

    Failed login. Killing me.

    I have a report that I am trying to view in Visual Basic. I was successful at this originally, but recently my database was ported over to another server. I was told that the connection would be basically identical, save the fact that a password would be required, when originally it wasn't necessary. So, I reset my database location in the crystal designer, saved the report again, and now I am getting an error every time I try to open the report.

    Logon failed.
    Details: ADO Error Code: 0x80040e4d
    Source: Microsoft OLE DB Provider for SQL Server
    Description: Login failed for user 'sa'.
    SQL State: 42000
    Native Error: 18456

    Keep in mind that I did make a successful connection and previewed the data in the Crystal Designer, so I have no idea what the problem would be. This is how I am invoking the report in vb.

    Dim Crystal As New CRAXDRT.Application()
    Dim Report As CRAXDRT.Report

    Crystal = New CRAXDRT.Application() 'MANAGES REPORTS
    Report = Crystal.OpenReport("PalletReport.rpt")
    CRViewer.ReportSource = Report 'LINK VIEWER TO REPORT
    CRViewer.ViewReport() 'SHOW REPORT
    CRViewer.Refresh()

    In the process of debugging, I tried to add this code to logon at runtime, but I received the same results.

    Crystal.LogOnServer("p2ssql.dll", "BDCFRAME6", "BDC_CSManager", "sa", sPassword)

    Any clues? Thanks in advance.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    122

    Sorted it out

    Here is what worked:

    Dim Crystal As New CRAXDRT.Application()
    Dim Report As CRAXDRT.Report
    Dim ConnectionInfo As CRAXDRT.ConnectionProperties

    Crystal = New CRAXDRT.Application() 'MANAGES REPORTS
    Report = Crystal.OpenReport("PalletReport.rpt") 'OPEN OUR REPORT
    ConnectionInfo = Report.Database.Tables(1).ConnectionProperties()
    ConnectionInfo.DeleteAll()

    'Add the OLE DB Provider
    ConnectionInfo.Add("Provider", "SQLOLEDB")
    'Add the physical server name
    ConnectionInfo.Add("Data Source", "BDCFRAME6")
    'Add the database name
    ConnectionInfo.Add("Initial Catalog", "BDC_CSManager")
    'Add the user name
    ConnectionInfo.Add("User ID", sUserID)
    'Add the password
    ConnectionInfo.Add("Password", sPassword)

    CRViewer.ReportSource = Report 'LINK VIEWER TO REPORT
    CRViewer.ViewReport() 'SHOW REPORT
    CRViewer.Refresh()

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