Jump to content

[Resolvido] Crystal Reports - Senha das Bases


Flatdnl
 Share

Recommended Posts

Bom Dia Galera, tenho o seguinte código:

 Public Sub Carrega_RPT(ByVal caminho As String)
        Dim crtableLogoninfos As New TableLogOnInfos
        Dim crtableLogoninfo As New TableLogOnInfo
        Dim crConnectionInfo As New ConnectionInfo
        Dim CrTables As Tables
        Dim CrTable As Table

        rpt.Load(caminho)

        With crConnectionInfo
            .ServerName = "SRVMCORE\SRVMG"
            .DatabaseName = "CNS_CE "
            .UserID = "sa"
            .Password = "cn$4dm1n"
        End With

        CrTables = rpt.Database.Tables

        For Each CrTable In CrTables
            MsgBox(CrTable.Location)
            crtableLogoninfo = CrTable.LogOnInfo
            crtableLogoninfo.ConnectionInfo = crConnectionInfo
            CrTable.ApplyLogOnInfo(crtableLogoninfo)
        Next

        cvRelatorios.ReportSource = rpt
        cvRelatorios.Refresh()
    End Sub

Meu problema é que nesse relatório eu tenho duas bases, e se eu utilizar esse código, ele loga somente em uma base, na hora que vai acessar a outra base, ele da erro!

Voces tem alguma idéia de como faço pra logar nas duas bases?

Desde ja agradeço.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.