[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 =
    ' set this to the right db driver
    crystalReport.Database.Tables(i).DllName = "crdb_ado.dll" 
    ' clear and reset
    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"
      crystalConnectionProperties.Add "Initial Catalog", "PRODDB"
    End If
  Next i

The Aha! was found at:

Thanks for the help folks :)


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

More information about the thelist mailing list