We help IT Professionals succeed at work.

Missing something on the deployment computers.  VB6 and Crystal 11.5

167 Views
Last Modified: 2020-10-05
I am a newbie with VB6 and Crystal, so I apologize for my simple question.

I am trying to integrate VB6 and Crystal 11.5 and I can do everything I want if I use the Access db.  We are now switching to SQL db and I can get the reports to work fine on the Dev machine, but not on the Deployed Computers.
Is there a tool to use to tell me what control or dll is missing?

I am using RDC with ADO and I keep getting a 429 error Axtivex cannot create object.
I've registered all the dlls that I know of.


Dim crxApplication As New CRAXDRT.Application
Public Report As New CRAXDRT.Report

 ConnectionString = "Provider=SQLOLEDB.1;DSN=" & SQLServerName & ";" & "Password=" & SQLPassword & ";Persist Security Info=True;User ID=" & SQLUsername & ";Initial Catalog=LimitlessDailyTransactions;Data Source=" & SQLServerName
            ConnectionString2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DB & ";Persist Security Info=False"
            Adodc1.ConnectionString = ConnectionString
            Adodc2.ConnectionString = ConnectionString2
           
            Adodc1.Refresh 'sql DailyTransactions
           
            Adodc2.Refresh  'xl.mdb
           
            Set Report = crxApplication.OpenReport(DatabaseFolderLocation & ReportName)
            Report.Database.Tables.Item(1).SetDataSource Adodc1.Recordset, 3
            If BolSingleTable = True Then
            Else
                Report.Database.Tables.Item(2).SetDataSource Adodc2.Recordset, 3
            End If
            Report.ReportTitle = ReportTitle
'----------------------------------------
'    Dim ConnectionString As String
'    Dim Conn1 As New ADODB.Connection
'    ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DB & ";Persist Security Info=False"
'    Conn1.ConnectionString = ConnectionString
'    Adodc1.ConnectionString = ConnectionString
'    Adodc1.Refresh
'--------------------------------------


        Me.WindowState = 2
        Me.Refresh
       
        CRViewer1.ReportSource = Report
        Screen.MousePointer = 0 'Default
        CRViewer1.Top = 0
        CRViewer1.Left = 0
        CRViewer1.Height = Me.Height
        CRViewer1.Width = Me.Width
        CRViewer1.ViewReport
        Me.Refresh
        ResetVariables
        ResetForm
        Exit Sub
Comment
Watch Question

John TsioumprisIT Supervisor
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Thank you for your reply!
On the dev machine or on the deployed computer?
I have not specifically installed that, but I do have a list of dll's that I was told to install and I do that on the deployed computer.
Where would I find it?
John TsioumprisIT Supervisor
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
because i had something similar some years ago ...i think this the missing piece in users machines..just search crystal reports 11.5 runtime

Author

Commented:
OK I'll try that
Senior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
OK I have the msm files but no clue how to "install them"
To be clear, all I am trying to do is run a 11.5 report from my VB6 code.  I will be connecting to an SQL db.
On the dev machine they work but always either an active X error or a dll error on the deployed machine.
Is there just a list of dll's needed for RDC?

Thank you for your help, again I apologize for having to ask it but I'm just getting started with programming.  One other note, I can get everything to work if I use an open access db but the sql is what is killing me.

Ralph
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
The list of required dlls is lengthy and trying a manual install would be prone to errors.

So you are saying it works fine on the server with Access?

Is the SQL client installed and the ODBC connection defined on the server?

mlmcc

Author

Commented:
I can deploy using an access connection. In crystal it is a DAO connection.  That deploys fine. Crystal 8.5.
The head programmer is now wanting me to replace my ODBC/DAO connection and connect to an sql db and use Crystal 11.5.
I think I am connecting to the sql db and use CRViewer.  At this point I have available VB6 and either Crystal 8.5 or 11.5.

here is the my sample test code I am using with 11.5:

Dim crxApplication As New CRAXDRT.Application
Public Report As New CRAXDRT.Report

Private Sub Form_Load()
Screen.MousePointer = vbHourglass

Set Report = crxApplication.OpenReport("C:\report3.rpt")
Report.Database.LogOnServerEx "p2soledb.dll", "SQLServerName", "DB Name", "user", "PW", "OLE DB(ADO)", "Provider=SQLOLEDB.1;DSN=SQLServername;Password=PW;User ID=user;Initial Catalog=DB;Data Source=SQLServername"

CRViewer1.ReportSource = Report

CRViewer1.ViewReport
Screen.MousePointer = vbDefault

End Sub

Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth

End Sub

SQL server  and sql db are on the deployment computer. No network connection at this point.
I'm not sure what sql client is..

the error I get on the deployment computer is
Runtime error 339
Component crviewer.dll or one of its dependencies is not properly registered a file is missing or invalid.

have run regsvr32 crviewer.dll and windows says its registered successfully.

If need be I can use Crystal 8.5...


Again, thank you for your reply..
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
Is this on the development machine?

mlmcc

Author

Commented:
Yes this is the code I'm using with vb6 and Cr11.5

Author

Commented:
The error is on the deployed computer
The development computer is time.
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
Did you install the runtimes for CR XI R2?

mlmcc

Author

Commented:
On Thr dev computer I loaded everything
Nothing on the deployed computer specifically.
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
Go to: https://blogs.sap.com/2011/06/07/where-did-all-the-crystal-reports-xi-r1-and-r2-fixes-go/ 
and use the CR XI R2 SP6 MSM for RDC link at the bottom.

mlmcc

Author

Commented:
I actually have that file, but no clue how to install(run) an MSM file.  this is for the Development computer, correct?  I have upgraded it to X1 SP6, or is this run on the deployment computer?
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
NO, it is installed on the client or server.  The development machine just needs Crystal Reports installed as that will install the appropriate dls for use in an application.

I believe it is generally included with the application in the deployment package.

See this from MS
https://docs.microsoft.com/en-us/windows/desktop/msi/merge-modules

mlmcc

Author

Commented:
Thank you,

I have been doing some research and I downloaded the Visual Installer Package 1.1 and was able to create an .exe that installs the msm files.
Now I just have to test it.  I hope this gets me farther along down the road...

Ralph

Author

Commented:
Ok, I've made a lot of progress with the crviewer runtime exe I made to install the msm file with the dlls.  My issue now it that the report is not getting the location variables.  It always tries to connect to the server that the report has in it.

This is how I am connecting:

Report.Database.LogOnServerEx "p2soledb.dll", SQLServerName, "LimitlessDailyTransactions", SQLUsername, SQLPassword, "OLE DB(ADO)", _
    "Provider=SQLOLEDB" _
        & ";Password=" & SQLPassword _
        & ";Persist Security Info=True" _
        & ";User ID=" & SQLUsername _
        & ";Initial Catalog=LimitlessDailyTransactions" _
        & ";Data Source=" & SQLServerName

I can only runt the report if I go in and change the reports location to what the clients is and obviously I can't do that.
I can't seem to use Logonserver to work but logonserverEX does work but not passing the location variables to the report.

Thanks for your assistance!
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
CHanging data source can be problematic.  That is one reason I recommend pushing the data to the report from an application dataset.

What location variables are you talking about?
Do you have parameters?

mlmcc

Author

Commented:
Yes I have parameters and they are getting passed.
The sqlservername, sqluserid, sqlpassword are the “location” I’m talking about not really a location but a sql dB on server for the report to use

im not against sending a record set and I could create one in vb, but I have no clue what I would need to do on the crystal side.  
If I could get an example I could probably run with it.
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:

Author

Commented:
Sorry I was away on a project for a few weeks.
That link is for .net and I am using VB6.

I am obviously not up to writing the code to pass the db location to the report(CRViewer)
Can you recommend someone or get with me on doing some training me (Paid, of course) or even at this point I would consider paying someone to write the code so I can run my crystal reports from VB from a computer that does not have the db on it.  I have the code done to get the variables and can pass them.  My only issue is passing the database location(data source?) to the report.  

VB6
Crystal 11.5
The main db is an access.mdb and the sales db is an sql db.  Some reports use one or the other or both.

Thank you for your reply.
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
Is the database always in the same place?

Can you define the report using a common location? (network share)

mlmcc

Author

Commented:
Thank you for your input.
I have figured out the code needed to pass the db location.

Report.Database.LogOnServerEx "p2soledb.dll", SQLServerName, "LimitlessDailyTransactions", SQLUsername, SQLPassword, "OLE DB(ADO)", _
    "Provider=SQLOLEDB" _
        & ";Password=" & SQLPassword _
        & ";Persist Security Info=True" _
        & ";User ID=" & SQLUsername _
        & ";Initial Catalog=LimitlessDailyTransactions" _
        & ";Data Source=" & SQLServerName

 Report.Database.Tables(1).SetLogOnInfo SQLServerName, "LimitlessDailyTransactions", SQLUsername, SQLPassword

I guess one creates a connection and the other logs on the SQL db.

Now I am getting the old error crviewer.dll or one of it's components is either missing or invalid.  I guess this is going to fight me every step of the way, but I'll figure it out.  I thought from an earlier post that since I created an exe that loads the crviewer XI viewer files that this error was taken care of but I guess not.

Again thanks for your help and thoughts for this.
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
Is that on the development machine or the client?

mlmcc

Author

Commented:
The client machine
I assume I’m need to load something other that the crviever.dll
I have loaded or I should say created annexe that loads the msm files that was mentioned earlier in the post.
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
The CRViewer should load with the msi or msm files

Try to do a new install.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions