Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 17-10-2008
Member
 
Join Date: Jan 2006
Posts: 211
Problem with VB6 and Crystal Reports 9

Hello!
I am using Crystal Reports 9 (under Win2000 with SP3/SP4 - no difference) and try to create some reports from vb6. Everything works fine..., unless I install the centura runtime (deploy20.exe). After the installation some (there is no telling which) integers are missing in the report. When debugging my visual basic sources (SetPrivateData) everything is fine and all the integers are filled with the proper values. (I am using ttx files and they are also all okay.)

Has anyone already experienced this problem? and (more important) does anyone has a suggestion on how to solve this problem??? (must be something with the ADO, mustn't it?)
Reply With Quote
  #2  
Old 17-10-2008
Member
 
Join Date: Dec 2007
Posts: 1,728
Did your code work once, and then quit, or did it never work.

You need to download and install the mysql odbc drivers from www.mysql.com
Reply With Quote
  #3  
Old 17-10-2008
Member
 
Join Date: Dec 2007
Posts: 2,273
How to use MySQL, Visual Basic 6, and Crystal Reports 9
So, you have a huge amount of data in your MySQL? database, and your users can move data in and out at will with the VB application that you wrote, but now they want the data in a more meaningful form. In the first Visual Basic application I wrote, I tried to give them summaries and reports by creating forms with dynamically allocated arrays of labels, building the form as I worked my way through the data.

While such a method worked, and the form looked fairly nice, making changes was difficult. Moving elements around on the form required modification of various constants that were used to control placement and spacing, and changes required a re-compile (granted, I could have loaded the constants from a text file, but I was new). Later, I discovered Crystal Reports?, a powerful tool for report generation. With Crystal Reports, I was able to rebuild my code-based report in a matter of minutes, and modify it at will. When a change was made, I simply had to replace the report file, and Visual Basic would show the new report the next time it was viewed. This really helped me save time on data reporting, and I was able to churn out new reports any time a user would request one.

One of the challenges I had when trying to work with Crystal Reports was getting the report to show in my VB application with data generated using an ADO recordset and MySQL. In fact, with the version of Crystal Reports that comes included with VB6 (version 4.6 of Crystal Reports), this feature was not really supported. I personally prefer to develop software without using a DSN, but in this case I had to make an exception and set up a DSN on my target system so that Crystal Reports could access live data, with the VB application modifying the selection formula of the report in order to allow the user control over what data was displayed in the report.

Fortunately, when I found myself a developer position in a company that is a reseller for Crystal Reports, and I found myself able to work with Crystal Reports 9. Moving from Crystal Reports 4.6 to Crystal Reports 9 was an improvement similar to moving from hard-coding reports to using Crystal Reports. Version 6 of Crystal Reports introduced Active Data, which allows us to create reports based on ADO provided data. Version 8 of Crystal Reports introduced the Report Designer Component, which greatly improved the way reports are loaded and viewed in VB. In this article I will cover designing and displaying reports using Visual Basic 6, Crystal Reports 9, and MySQL. In a future article I will also cover displaying data with Crystal Reports versions 6 and 4.6.

This article will assume that the reader is using the MySQL RDBMS, but should apply to developers using other database management systems. For an overview of why MySQL is a good choice for Visual Basic developers, see the Why VB/MySQL article on this site. Further information on MySQL, along with full downloads, can be obtained from the MySQL web site. This sample will require the latest version of Connector / ODBC (formerly MyODBC), available for download here (currently 3.51.06). As I stated, this article will be based on Crystal Reports 9 (evaluation copy available for download here). I recommend installing maintenance pack 1 and all monthly hot fixes, available through support.crystaldecisions.com.

On the Visual Basic side, I recommend you have service pack 5 installed for VB, which you can download here. Additionally, the latest version of MDAC (Microsoft Data Access Components) should be installed, and can be found here (currently 2.7 SP1). Finally, this article applies to ADO 2.7 and VB6. It is not applicable to ADO.NET under VB.NET (Unless you reference ADODB in your project and use it for database access).

For more information see the direct website: http://www.vbmysql.com/articles/vb6-...stal-reports-9
Reply With Quote
  #4  
Old 17-10-2008
Member
 
Join Date: Dec 2007
Posts: 1,592
Did you use DSR files or were the reports built independently? If so you can try importing the RPT files.
Reply With Quote
  #5  
Old 17-10-2008
Member
 
Join Date: Jan 2006
Posts: 211
I think I may have solved it - I re-installed Crystal Reports 9 on another machine with Visual Studio 6, and one of the options for CR installation was a feature that allows exporting the reports in RPT format. I installed this, and on each report in VB, I can open it, and then use the Report-Save as Report option to save the report as a .RPT file. I have done this for all 35 of the reports, and Visual Studio and Crystal reports seems to accept the new reports and displays them properly.

thanks for suggesting importing the RPT files, that triggered me to look for this option.
Reply With Quote
  #6  
Old 30-01-2009
Member
 
Join Date: Jan 2009
Posts: 3
Re: Problem with VB6 and Crystal Reports 9

hii......
I'hv unable to connect with MySql for creating report using VB-6.Though i'hv follow the step.....my step...is like that..

1st STEP...

Using the report expart

2nd stp-
Crt nwe conctn

3dr stp-
OLEDB (ADO)
OLEDB Provider ODBC driver

4th stp
ODBC DSN
DSN name

5t stp

data source-
database-
usr id
pswd-

6th stp
Conct time out -15
Locale Identifier- 1033
OLEDB Service- -5(-ve)
General time out

when click finish
1 error is comng..like
Logon failed
DETALS:ADO Error Code :
srcROVIDER
Navtive..error.....

Plz...help me..........
Reply With Quote
  #7  
Old 30-01-2009
Member
 
Join Date: Aug 2008
Posts: 145
Re: Problem with VB6 and Crystal Reports 9

Hey try this in your code

Code:
 Dim li As TableLogOnInfo = New TableLogOnInfo()


            li.ConnectionInfo.ServerName = "servername"
            li.ConnectionInfo.UserID = "userid"
            li.ConnectionInfo.Password = "password"
            CrystalReportViewer1.ReportSource = CrystalReportSource1
            CrystalReportViewer1.LogOnInfo.Add(li)
Hope this helps you.
Reply With Quote
  #8  
Old 30-01-2009
Member
 
Join Date: Jan 2009
Posts: 3
Re: Problem with VB6 and Crystal Reports 9

[quote=Gauresh;4209988]Hey try this in your code

Code:
 Dim li As TableLogOnInfo = New TableLogOnInfo()


            li.ConnectionInfo.ServerName = "servername"
            li.ConnectionInfo.UserID = "userid"
            li.ConnectionInfo.Password = "password"
            CrystalReportViewer1.ReportSource = CrystalReportSource1
            CrystalReportViewer1.LogOnInfo.Add(li)


hi......i'hv tried it but no result...actually i'm new in vb6...so..i'm..facing the probs..i want to create manually conncntion with mysql..frm crystal report...using vb-6..not vb.net
Reply With Quote
  #9  
Old 09-02-2009
Member
 
Join Date: Jan 2009
Posts: 3
how to convert a string into a characher array in vb-6

Dear
Friends i'hv already used mid function and also UBound using for loop...but..unable..to...convert into character array.....i'm..new in ..vb.Plz..can any..one..help..me????
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Problem with VB6 and Crystal Reports 9"
Thread Thread Starter Forum Replies Last Post
crystal reports 9 for excel 2003 shankar.nstl Software Development 4 20-09-2011 11:05 AM
Crystal Reports Tutorial needed Miltongomes Software Development 4 29-09-2010 12:30 PM
How to generate Java with Crystal Reports Cadallic Software Development 3 04-08-2009 12:15 PM
Refresh prob in Crystal Reports 9 from VB6 supun24 Software Development 1 07-07-2009 11:00 AM
opensource alternative for crystal reports StephanieRice Software Development 3 29-05-2009 11:47 AM


All times are GMT +5.5. The time now is 05:49 PM.