Link to home
Start Free TrialLog in
Avatar of airvector
airvectorFlag for United States of America

asked on

Crystal Report Prompted Database Login

Everything run well on Dev Machine.
Testing on client prompted Database Login
Tried entering the required information does not work, kept saying Login failed no matter what.

Tried on vb.net

objReport.SetDatabaseLogon("user", "pass")

still isn't going thru

on the rpt file i used connectionstring:

DRIVER={MySQL ODBC 5.1 Driver};DATABASE=mydb;OPTION=3;SERVER=myServer;UID=myUser;PWD=myPassword



Avatar of Mike McCracken
Mike McCracken

Does the test have the same database and same connection string?

mlmcc
Avatar of airvector

ASKER

Test was done using same Database, user, pass, server

vb.net used:

With crConnectionInfo
           .ServerName = "server"
           .DatabaseName = "db1"
           .UserID = "client"
           .Password = "pass"
End With

Crystal Report Document uses:
DRIVER={MySQL ODBC 5.1 Driver};DATABASE=mydb;OPTION=3;SERVER=myServer;UID=myUser;PWD=myPassword
Are you changing the database as it appears since the last line has different values from the connection info.

mlmcc
this is my script that i tried

it works on Dev machine and not on the client
Dim CRViewer As New FormCrystalViewer
        Dim CRViewer As New FormCrystalViewer
        Dim objReport As New ReportDocument
 
        'Load Crystal Report File
        objReport.Load(My.Settings.CR_PATH & "CRLateOrders.rpt")
 
        Dim crTableLogonInfos As New TableLogOnInfos
        Dim crTableLogonInfo As New TableLogOnInfo
        Dim crConnectionInfo As New ConnectionInfo
        Dim crTables As Tables
        Dim crTable As Table
 
        With crConnectionInfo
            '.ServerName = "server"
            '.DatabaseName = "db"
            .UserID = "client"
            .Password = "pw"
        End With
 
        crTables = objReport.Database.Tables
 
        For Each crTable In crTables
            crTableLogonInfo = crTable.LogOnInfo
            crTableLogonInfo.ConnectionInfo = crConnectionInfo
            crTable.ApplyLogOnInfo(crTableLogonInfo)
        Next
 
       CRViewer.CRViewer.ReportSource = objReport
       CRViewer.Show()

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Totally forgot about that