Subject: Crystal R.9 -> ConnectBufferstring read only?
Posted By: Kris DExelle Post Date: 9/23/2003 3:08:51 AM
Hi,

When I try to set the ConnectBufferString property, I get the following error:
"this property is currently in a read only state and cannot be modified"
(I'm using Crystal Reports 9)

Any ideas?

Thx,

Kris


Private Sub ConnectReports(ByVal aBuilder As IPreviewBuilder, areportrouter As ReportSourceRouter)
   Dim i As Integer
   Dim strConnectionBuffer
   Dim objDatabaseTable As CRAXDRT.DatabaseTable
   On Error GoTo Cleanup
   
   strConnectionBuffer = _
      "Server=" & m_conMain.Properties("Data Source").Value & ";;" & _
      "User ID=" & m_conMain.Properties("User Name").Value & ";;" & _
      "Password=" & m_conMain.Properties("Password").Value

   For i = 0 To (aBuilder.ReportCount - 1)
      With aBuilder.Report(i).CRReport
         .EnableParameterPrompting = False
         If .Database.Tables.Count > 0 Then
            If Not (aBuilder.Report(i).IsConnected) Then
                     .Database.LogOnServer CR_ORACLEDLL, _
                                    m_conMain.Properties("Data Source").Value, , _
                                    m_conMain.Properties("User Name").Value, _
                                    m_conMain.Properties("Password").Value
               For Each objDatabaseTable In .Database.Tables
                  objDatabaseTable.ConnectBufferString = strConnectionBuffer
               Next
            End If
         End If
      End With
      areportrouter.AddReport aBuilder.Report(i).CRReport
      aBuilder.Report(i).IsConnected = True
   Next i

Cleanup:
...

End Sub

Reply By: bhuvan01 Reply Date: 7/9/2004 8:54:23 AM
I'm also getting the same problem.. did you found any solution....


Please help me..



Reply By: markshervey Reply Date: 10/29/2004 4:38:04 PM
I also am getting the same problem, if you have figured out this problem, I'd appreciate any tips.  

This is the only result when I google the error.


Thanks a bunch in advance!!!

Mark Shervey


quote:
Originally posted by Kris DExelle

Hi,

When I try to set the ConnectBufferString property, I get the following error:
"this property is currently in a read only state and cannot be modified"
(I'm using Crystal Reports 9)

Any ideas?

Thx,

Kris


Private Sub ConnectReports(ByVal aBuilder As IPreviewBuilder, areportrouter As ReportSourceRouter)
   Dim i As Integer
   Dim strConnectionBuffer
   Dim objDatabaseTable As CRAXDRT.DatabaseTable
   On Error GoTo Cleanup
   
   strConnectionBuffer = _
      "Server=" & m_conMain.Properties("Data Source").Value & ";;" & _
      "User ID=" & m_conMain.Properties("User Name").Value & ";;" & _
      "Password=" & m_conMain.Properties("Password").Value

   For i = 0 To (aBuilder.ReportCount - 1)
      With aBuilder.Report(i).CRReport
         .EnableParameterPrompting = False
         If .Database.Tables.Count > 0 Then
            If Not (aBuilder.Report(i).IsConnected) Then
                     .Database.LogOnServer CR_ORACLEDLL, _
                                    m_conMain.Properties("Data Source").Value, , _
                                    m_conMain.Properties("User Name").Value, _
                                    m_conMain.Properties("Password").Value
               For Each objDatabaseTable In .Database.Tables
                  objDatabaseTable.ConnectBufferString = strConnectionBuffer
               Next
            End If
         End If
      End With
      areportrouter.AddReport aBuilder.Report(i).CRReport
      aBuilder.Report(i).IsConnected = True
   Next i

Cleanup:
...

End Sub





Reply By: tslu Reply Date: 12/15/2004 3:08:35 AM
Try this:

For Each objDatabaseTable In .Database.Tables
    objDatabaseTable.ConnectionProperties.DeleteAll
    objDatabaseTable.ConnectBufferString = strConnectionBuffer
Next


Reply By: bob_uk Reply Date: 3/29/2005 8:03:01 AM
I get exacly the same error message although I don't use ConnectBufferString property. Does anybody get any results
on this?

Any help will be greatly appreciated.

Reply By: R3nn Reply Date: 7/18/2005 7:42:39 AM
The ConnectBufferString property only needs to be set once; on the first Table in the collection. You will notice the above error will always show up on the second table. This ought to fix the problem.

There is one other workaround; if you're using Crystal 10 you can use the CrystalDesignRuntime.Application instead of the CrystalRuntime.Application... it seems to ignore the problem. Note that this doesn't work on version XI (11)
Reply By: Kazumar Reply Date: 8/31/2006 10:52:20 AM
I had the same problem and found that the easiest/best fix was to just set the ConnectionBufferString every time I opened a report and just caught the exception if it was thrown, and ignored it.  That way you don't have to keep track of whether this is the first report opened or second or if they closed one and are opening a new one, etc.

Go to topic 49033

Return to index page 188
Return to index page 187
Return to index page 186
Return to index page 185
Return to index page 184
Return to index page 183
Return to index page 182
Return to index page 181
Return to index page 180
Return to index page 179