Hi all,

I am having a problem changing my crystal reports to use trusted connections.
I have a vb6 app connecting to an sql db, and the reports are crystal reports 8.
They all worked fine until the customer wanted us to use there network logins as authentication.
So i changed the application to use trusted connections and took out the user and password in the connection string.
This worked ok.
But when it came to change the reports i get the message server has not yet been opened.
It will not connect to the sql db.
Here is my code so far:
Code:
    Dim CRXApplication As New CRAXDRT.Application
    Dim CRXReport As CRAXDRT.Report
    Dim CRXDatabase As CRAXDRT.Database
    Dim CrDatabaseTable As CRAXDRT.DatabaseTable
    
    Set CRXReport = CRXApplication.OpenReport(APPConst.DatabasePath & stReport & ".rpt")
    CRXReport.DiscardSavedData
    
    For Each CrDatabaseTable In CRXReport.Database.Tables
       'CrDatabaseTable.SetLogOnInfo APPConst.Server, APPConst.Database, APPConst.user, APPConst.DatabasePassword
        CrDatabaseTable.SetLogOnInfo APPConst.Server, APPConst.Database
        stTable = CrDatabaseTable.TestConnectivity
    Next
Dim crpParamDefs As CRAXDRT.ParameterFieldDefinitions
    Dim crpParamDef As CRAXDRT.ParameterFieldDefinition
    CRXReport.EnableParameterPrompting = False
    Set crpParamDefs = CRXReport.ParameterFields
    For Each crpParamDef In crpParamDefs
        With crpParamDef
            Select Case .ParameterFieldName
            Case "Name"
                .ClearCurrentValueAndRange
                .SetCurrentValue APPConst.UserName
            End Select
        End With
    Next
    
    crViewer.Height = 9400
    crViewer.Width = 14900
    crViewer.Top = 50
    crViewer.Left = 50
    crViewer.EnableGroupTree = False
    crViewer.EnableRefreshButton = False
    crViewer.EnableSearchControl = False
    crViewer.ReportSource = CRXReport
    crViewer.Visible = True
    crViewer.ViewReport
sttable is coming back false where it was true before the changes.

Any advice would be appriciated.

Ian.