Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Crystal Reports changing oracle odbc connections at runtime

Crystal Reports changing oracle odbc connections at runtime

Scheduled Pinned Locked Moved Visual Basic
helpdatabaseoracledesigntesting
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cristina Rodriguez Garcia
    wrote on last edited by
    #1

    I have a problem. I have a report that in design time link with database with an odbc (Oracle provider). In runtime if i don´t change connection it works fine. My problem is that if i change de odbc (i try other odbc with other name but with same dns) at runtime, it doesn´t work. Only works if i change odbc connection in report at design time...but i need do it programtilly because i need user choose between two equals databases: real and testing. I try with code like Me.rptDoc.DataSourceConnections.Item(0).SetConnection("ODBCNAME", "", False) and other codes like that: Dim crConnectionInfo As ConnectionInfo Dim crDatabase As Database Dim crTables As Tables Dim crTableLogOnInfo As TableLogOnInfo Dim crReportDocument As ReportDocument = Me.rptDoc crDatabase = crReportDocument.Database crTables = crDatabase.Tables crConnectionInfo = New ConnectionInfo() crConnectionInfo.ServerName = "ODBCNAME" crConnectionInfo.DatabaseName = "" crConnectionInfo.UserID = "USER" crConnectionInfo.Password = "PASSWORD" For Each aTable As CrystalDecisions.CrystalReports.Engine.Table In crTables crTableLogOnInfo = aTable.LogOnInfo crTableLogOnInfo.ConnectionInfo.AllowCustomConnection = True crTableLogOnInfo.ConnectionInfo = crConnectionInfo aTable.ApplyLogOnInfo(crTableLogOnInfo) Next Could you help me?, thanks in advance Cristina

    C 1 Reply Last reply
    0
    • C Cristina Rodriguez Garcia

      I have a problem. I have a report that in design time link with database with an odbc (Oracle provider). In runtime if i don´t change connection it works fine. My problem is that if i change de odbc (i try other odbc with other name but with same dns) at runtime, it doesn´t work. Only works if i change odbc connection in report at design time...but i need do it programtilly because i need user choose between two equals databases: real and testing. I try with code like Me.rptDoc.DataSourceConnections.Item(0).SetConnection("ODBCNAME", "", False) and other codes like that: Dim crConnectionInfo As ConnectionInfo Dim crDatabase As Database Dim crTables As Tables Dim crTableLogOnInfo As TableLogOnInfo Dim crReportDocument As ReportDocument = Me.rptDoc crDatabase = crReportDocument.Database crTables = crDatabase.Tables crConnectionInfo = New ConnectionInfo() crConnectionInfo.ServerName = "ODBCNAME" crConnectionInfo.DatabaseName = "" crConnectionInfo.UserID = "USER" crConnectionInfo.Password = "PASSWORD" For Each aTable As CrystalDecisions.CrystalReports.Engine.Table In crTables crTableLogOnInfo = aTable.LogOnInfo crTableLogOnInfo.ConnectionInfo.AllowCustomConnection = True crTableLogOnInfo.ConnectionInfo = crConnectionInfo aTable.ApplyLogOnInfo(crTableLogOnInfo) Next Could you help me?, thanks in advance Cristina

      C Offline
      C Offline
      Cristina Rodriguez Garcia
      wrote on last edited by
      #2

      I has just the solution! I need to put a new line with table.location = "schemaName" & table.location after applylogoninfo! I found solution here: http://www.codecomments.com/Visual Basic Crystal Reports/message690985.html Thanks for all Cris

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups