2016-03-25 20 views
0

VB.NET'te yazılmış bir uygulamanız var. Bir süre önce 32 bit mimaride bir müşteri için yazılmıştır. Veritabanı, MySQL 5.5'tür. Raporlar dahili Crystal raporları ve veritabanı bağlantısı bir DSN üzerinden ODBC 32bit MySQL konnektörü idi.Crystal Reports için MySQL DSN bağlantısı ile VB.NET uygulaması Logon bilgi için sorar

Artık istemci tüm istemcileri Windows 10'a (64bit) yükseltti. Masaüstü uygulaması aynı eski 32bit bağlayıcısında iyi çalışır, ancak herhangi bir rapor çalıştırıldığında, oturum açma ekranı ister. Maalesef, çalışma zamanında giriş kimlik bilgilerinin iletilmesi işe yaramıyor.

Kod ekte olduğu gibidir. Bütün cevaplara göz attım ama kodlar işe yaramıyor. Kaybettiğim bir şey mi var? Biri yardım edebilir mi? Sorunun eski olduğunu biliyorum, ancak birkaç yıldır çalışan bir uygulama ve gerçekten yeniden yazmaya ihtiyacımız yok.

Kodu: (a düğmesi bağlantısını Aranan)

Public Sub PrintAmcRemainderForIndus(ByVal componentId As Integer, ByVal AddressId As Integer)   
    'Dim cryRpt As New ReportDocument 
     Dim rPath As String = "" 
     Dim objForm As New frmViewReport 
    rPath = Application.StartupPath & "\Reports\rptAMCReminderForIndus.rpt"' 
    MessageBox.Show(rPath.Length & vbCrLf & rPath) 
    Dim crtableLogoninfos As New TableLogOnInfos() 
    Dim crtableLogoninfo As New TableLogOnInfo() 
    Dim crConnectionInfo As New ConnectionInfo() 
    Dim CrTables As Tables 
    Dim CrTable As Table 
    Dim TableCounter 

    Dim cryRpt As New rptAMCReminderForIndus() 


    'If you are using ODBC, this should be the DSN name NOT the physical server name. If 
    'you are NOT using ODBC, this should be the 
    'physical server name 

    With crConnectionInfo 
     .ServerName = "Indus" 

     'If you are connecting to Oracle there is no 
     'DatabaseName. Use an empty string. 
     'For example, .DatabaseName = "" 

     .DatabaseName = "indus" 
     .UserID = "root" 
     .Password = "simsoft" 
    End With 

    'This code works for both user tables and stored 
    'procedures. Set the CrTables to the Tables collection 
    'of the report 
    CrTables = cryRpt.Database.Tables 


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

    Try 

     'cryRpt.Load(rPath) 

     Dim crParameterFieldDefinitions As ParameterFieldDefinitions 
     Dim crParameterFieldDefinition As ParameterFieldDefinition 
     Dim crParameterValues As New ParameterValues 
     Dim crParameterDiscreteValue As New ParameterDiscreteValue 

     crParameterValues.Clear() 

     crParameterDiscreteValue.Value = componentId 
     crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields 
     crParameterFieldDefinition = crParameterFieldDefinitions.Item("piCustomerId") 
     crParameterValues = crParameterFieldDefinition.CurrentValues 
     crParameterValues.Add(crParameterDiscreteValue) 
     crParameterFieldDefinition.ApplyCurrentValues(crParameterValues) 

     crParameterDiscreteValue.Value = AddressId 
     crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields 
     crParameterFieldDefinition = crParameterFieldDefinitions.Item("piAddressId") 
     crParameterValues = crParameterFieldDefinition.CurrentValues 
     crParameterValues.Add(crParameterDiscreteValue) 
     crParameterFieldDefinition.ApplyCurrentValues(crParameterValues) 

     objForm.rptViewer.ReportSource = cryRpt 
     objForm.Show() 
    Catch ex As Exception 
     MessageBox.Show(ex.Message & vbCrLf & ex.InnerException.Message) 
    End Try 


End Sub 

cevap