ERRO CRYSTAL REPORT 11.5 + VB6
Private Sub ConectarRelatorioPassedeDados(DNSSistema AS STRING)
Dim DBTabela AS INTEGER
Dim T AS INTEGER
Dim NomTable AS STRING
Dim StrCon AS STRING
StrCon = "DRIVER={MySQL ODBC 3.51 Driver};UID=" & UserDSN & ";PWD=" & PassDSN & ";Server=" & ServeIP & ";port=" & PortaDSN & ";Database=" & Base
DBTabela = CrxRep.DATABASE.Tables.Count
FOR T = 1 TO DBTabela
NomTable = CrxRep.DATABASE.Tables(T).Location
WITH CrxRep.DATABASE.Tables(T).ConnectionProperties
.DeleteAll
.ADD "Connection String", StrCon
END WITH
CrxRep.DATABASE.Tables(T).Name = NomTable
CrxRep.DATABASE.Tables(T).Location = Base & "." & NomTable
NEXT T
END sub
MAS QUANDO MIGRO PRO CRYSTAL REPORT 11.5 DA ERRO BEM NESTA LINHA
CrxRep.DATABASE.Tables(T).Location = Base & "." & NomTable
BASE DE DADOS QUE USO E MYSQL 5.7 COM ODBC
ESSE E O ERRO :
Argumento inválido fornecido.
Detalhes: O alias solicitado "estbos", contém uma combinação de caracteres que não é considerada válida.
Public Relatorio As New CRAXDRT.Report
Public Aplicacao As New CRAXDRT.Application
Public BancoCrystal As CRAXDRT.DatabaseTable
Sub rptVisualizar(Optional NomeArquivo As String)
Relatorio.DiscardSavedData
For Each BancoCrystal In Relatorio.Database.Tables
BancoCrystal.ConnectionProperties.DeleteAll
BancoCrystal.ConnectionProperties.Add "Port", BD_Porta
BancoCrystal.ConnectionProperties.Add "User", BD_Usuario
BancoCrystal.ConnectionProperties.Add "Server", BD_Servidor
BancoCrystal.ConnectionProperties.Add "Database", BD_Banco
BancoCrystal.ConnectionProperties.Add "Password", BD_Senha
BancoCrystal.ConnectionProperties.Add "Driver", "{MySQL ODBC 3.51 Driver}"
Next BancoCrystal
Set TabelaRPT = Relatorio.Database.Tables
For Each BancoCrystal In TabelaRPT
If LCase(BancoCrystal.Name) = "cliente" Then
NomeTabela = "entidade"
Else
NomeTabela = LCase(BancoCrystal.Name)
End If
BancoCrystal.Location = BD_Banco & "." & NomeTabela
Next
If NomeArquivo = "" Then
With Frm_Preview.crView
.DisplayGroupTree = False
.DisplayTabs = False
.EnableDrillDown = False
.EnableRefreshButton = False
.ReportSource = Relatorio
.ViewReport
.Zoom (1)
While .IsBusy
DoEvents
Wend
End With
Frm_Preview.Show
Set Relatorio = Nothing
Else
With Relatorio
.ExportOptions.FormatType = crEFTPortableDocFormat
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.DiskFileName = NomeArquivo
.ExportOptions.PDFExportAllPages = True
.Export False
End With
End If
End Sub
Citação::
TENHO ESSA FUNÇÃO QUE FUNCIONA BEM COM VB6 + CRYSTAL REPORTS 9.2
Private Sub ConectarRelatorioPassedeDados(DNSSistema AS STRING)
Dim DBTabela AS INTEGER
Dim T AS INTEGER
Dim NomTable AS STRING
Dim StrCon AS STRING
StrCon = "DRIVER={MySQL ODBC 3.51 Driver};UID=" & UserDSN & ";PWD=" & PassDSN & ";Server=" & ServeIP & ";port=" & PortaDSN & ";Database=" & Base
DBTabela = CrxRep.DATABASE.Tables.Count
FOR T = 1 TO DBTabela
NomTable = CrxRep.DATABASE.Tables(T).Location
WITH CrxRep.DATABASE.Tables(T).ConnectionProperties
.DeleteAll
.ADD "Connection String", StrCon
END WITH
CrxRep.DATABASE.Tables(T).Name = NomTable
CrxRep.DATABASE.Tables(T).Location = Base & "." & NomTable
NEXT T
END sub
MAS QUANDO MIGRO PRO CRYSTAL REPORT 11.5 DA ERRO BEM NESTA LINHA
CrxRep.DATABASE.Tables(T).Location = Base & "." & NomTable
BASE DE DADOS QUE USO E MYSQL 5.7 COM ODBC
ESSE E O ERRO :
Argumento inválido fornecido.
Detalhes: O alias solicitado "estbos", contém uma combinação de caracteres que não é considerada válida.
Set TabelaRPT = Relatorio.Database.Tables
For Each BancoCrystal In TabelaRPT
If LCase(BancoCrystal.Name) = "cliente" Then
NomeTabela = "entidade"
Else
NomeTabela = LCase(BancoCrystal.Name)
End If
BancoCrystal.Location = BD_Banco & "." & NomeTabela
Next
If LCase(BancoCrystal.Name) = "cliente" Then cliente o que seria ?
NomeTabela = "entidade" ?