[thelist] Crystal Reports Question [SOLVED]

Scott Dexter dexilalolai at yahoo.com
Wed Sep 8 09:50:23 CDT 2004


well, I think I got it.

I had to go through all the reports (17 of them) and change them from
RDO to ADO connections, which then allowed me to programatically
tweak the connection at runtime. Once that was done, here's the code
I use to point where I need to:

  ' loop to walk through any sub reports too
  For i = 1 To crystalReport.Database.Tables.Count
    Set crystalConnectionProperties =
crystalReport.Database.Tables(i).ConnectionProperties
    ' set this to the right db driver
    crystalReport.Database.Tables(i).DllName = "crdb_ado.dll" 
    ' clear and reset
    crystalConnectionProperties.DeleteAll
    crystalConnectionProperties.Add "Provider", "SQLOLEDB"
    crystalConnectionProperties.Add "Data Source", GrptServer
    crystalConnectionProperties.Add "Integrated Security", 1
  
    ' where are we looking?
    If InStr(UCase(fullPathName), "DEV") > 0 Then
      crystalConnectionProperties.Add "Initial Catalog", "DEVDB"
    ElseIf InStr(UCase(fullPathName), "TEST") > 0 Then
      crystalConnectionProperties.Add "Initial Catalog", "TESTDB"
    Else
      crystalConnectionProperties.Add "Initial Catalog", "PRODDB"
    End If
  Next i


The Aha! was found at:
http://support.businessobjects.com/communityCS/TechnicalPapers/cr_rdc9_connectionproperties.pdf

Thanks for the help folks :)

sgd

--- "Luther, Ron" <ron.luther at hp.com> wrote:



More information about the thelist mailing list