Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 23rd, 2003, 03:08 AM
Registered User
 
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Crystal R.9 -> ConnectBufferstring read only?

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

 
Old July 9th, 2004, 08:54 AM
Registered User
 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm also getting the same problem.. did you found any solution....


Please help me..



 
Old October 29th, 2004, 04:38 PM
Registered User
 
Join Date: Oct 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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:
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

 
Old December 15th, 2004, 04:08 AM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this:

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


 
Old March 29th, 2005, 09:03 AM
Registered User
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

 
Old July 18th, 2005, 07:42 AM
Registered User
 
Join Date: Jul 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to R3nn
Default

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)
 
Old August 31st, 2006, 10:52 AM
Registered User
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
<ask> How to add value to crystal report? qiux Crystal Reports 0 June 23rd, 2008 12:49 AM
Chpt 7 >> Pg 245 >>Try It Out #4-5 harrison4411 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 March 2nd, 2006 06:26 PM
how to read values from crystal viewer control? king910 BOOK: Beginning Java 2 0 July 26th, 2005 01:36 PM
Achitecture ? SQL -> XML -> ASP -> PDF or HTML Frm jstrong Classic ASP XML 0 July 9th, 2005 01:18 PM
/-/ow >>Crystal Report in ASP?? ahm Classic ASP Databases 0 May 21st, 2005 03:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.