Visual Basic Help - Phone-Book
Microsoft Visual Basic 6.0 help and Tutorials
MS-Visual Basic 6.0 & MS-Access 2003 - Crystal Reports to create a desktop software professionally
(6) Using Crystal Reports 4.6 in VB 6.0 project
    • Crystal Reports History :
      it was first released in 1991 by the Cunningham Group under titled (Quick Reports), then another version came up by (Seagate Software) in 1994 and that was until version 3.0, then automatically rebranded to a new product called (Crystal Decision) from version 4.0 to version 9.0 which acquired in 2003 by a company called (Business Objects) and they produced version 10.x, 11.x, 12.x until 2008. SAP acquired the application and produced (SAP Crsytal Reports 14) in 2011.
    • Download :
      Crystal Reports 4.6 can be downloaded from mediafire.com free server directly from here (Download), Crystal Reports 4.6 is owned by SAP company now by the way.
    • After downloading :
      You will find in the downloaded folder called [CR4.6+upgrade.rar] a folder with the same name contains these files in the following photo :

    Crystal Reports 4.6

    • Now, does your Visual Basic 6.0 supports working with Crystal Reports 4.6 ?
      In order to answer this question you need to check whether your VB6 is updated to SP6 only this update will make Crystal Reports 4.6 and so many other controls included work.
      To know if your VB6 is up-to-date SP6, simply open VB6 and see the (About Microsoft Visual Basic) section in the Help from menu, like in the photo below :

    vb6sp6

    • If you don't have the Service Pack 6.0 for Microsoft Visual Basic 6.0 then you need to download it from Microsoft offecial website from this link the file is called Vs6sp6B and is free to download or from my Mediafire link for here. To install the latest SP6 update for Microsoft Visual Basic 6.0 Vs6sp6B, follow me now :
      (1) Exit all the VB6 projects and Microsoft Office if opened.
      (2) After downloading the file ( Vs6sp6B ), create a new folder (Temp) in your (C:\) drive
      (3) Double-Click the (Vs6sp6B self extracted) file, and browse to the C:\Temp\ folder and click (OK)
      (4) Files are now extracted to C:\Temp\, open this folder and click on the file (setupsp6.exe)
      (5) Follow the installation proccess until successfully installed.
      (6) Restart your Microsoft Windows and you can now delete the ( C:\Temp\ ) folder if you wish to.
    • Now, when you open Microsoft Visual Basic 6.0 you will notice that most of the Compnents are (SP6) updated successfully and you can see the SP6 as in the photo above.
    • Now we can install Crystal Reports 4.6, follow me :
      (1) Open the folder where we downloaded Crystal Reports 4.6, double-click on the file called (CRYSTL32 self-extractor), click (Yes) on the message appeared to you.
      (2) You will notice another browsing box, if you have VB6 correctly installed on your Microsoft Windows then you will find the destination path is (C:\Program Files\Microsoft Visual Studio\Common), if not, then just copy this path and paste it in the browsing box.
      Install Crystal Reports 4.6 for visual basic
      (3) The installation proccess will start automatically and won't take time until you see this message (Installation of Crystal Reports has been completed successfully)
      Crystal Reports 4.6 installation for vb 6.0
    • To make sure that Crystal Reports 4.6 is successfully installed with Visual Basic 6.0, follow me:
      (1) Open Microsoft Visual Basic 6.0, Standard EXE and see under the (Add-Ins) menu, you will find (Report Designer), now this is Crystal Reports 4.6 installed successfully with Visual Basic 6.0.
    • One last step is to upgrade the Crystal Reports files using the (UpGrade) folder found in the [CR4.6+upgrade.rar] under titles (Crystal Reports 4.0) , you will find 3 DLL files, take a copy of them and paste it in this destination folder (C:\Windows\system32\), when it asks (If you want to replace with old files), say (Yes) .

    Upgrade crystal reports 4.6

    • Restart you Microsoft Windows for the last time. Now you have successfully downloaded, installed and upgraded Crystal Reports 4.6 on Microsoft Visual Studio 6.0
    • Create New Crystal Report

    • Now, want to create a new crystal report to list all of the friends stored in the MS-Access 2003 Database table (Phones) , we can do that by :
      (1) From our application project, navigate to (Add-Ins) choose (Report Designer), you will see the Crystal Reports 4.6 start-up screen.
      Crystal Reports 4.0 for VB6
      (2) Navigate to (File) menu and choose (New)
      (3) Choose the (Standard) report templete as in the photo below.
      New report for vb6
      (4) Then choose our Database file (MyBook.mdb) from the browsing box, see photo below
      Access 2003 with Crystal Reports 4.6
      (5) Click on (Done), it will take you to the (Fields) tap to choose the Database field you wish to include in your Crystal Report and don't include the Fpic field, see photo below
      Crystal Reports - Fields
      (6) The (Sort) tap, choose the (ID) field and click on (Next)
      (7) Click on (Next) until you reach the (Style) tab, choose the standard style.
      Crystal Reports 4.0 - report style
      (8) Now click on (Preview Report), you will notice the table fields.
      (9) Important, to correctly save the report, from (File) uncheck (Save Data with report) then click (Save As ...), choose a name for the report (Friends.rpt) inside your main folder (PhoneBook) ... see photo below :
      Save Data with report
      (10) If you wish to design the report, it is easy to do, just design as you wish but remember to always save the report.
    • When you open your project folder, you will notice a new file called (Friends.rpt), this is the report file, you can open it to edit it or design it, Crystal Reports 4.6 is a stand-alone application after all.
    • To include Crystal Reports 4.6 OCX in your visual basic project, follow the photo below :
      Crsytal reports vb6 OCX
      CR 4.6 Ocx vb6
    • Place this (OCX) on your form (Display.frm) and name the control OCX (CR) from the properties panel (Name property)

    Crystal Report Code

    • Copy and paste the following code in the (CmdPrint Click()) event in your visual basic IDE :

    This code will allow you to open the report and display the friends Data stored in the database table.

    • Now, save your application and test it. Try the (Print) button on the Display form, notice the friends Data are listed in the report.

    Crystal Report 4.0 run-time

     

    Crystal Report connection with a Password protected Database

  • How to connect a Crystal Report with a MS-Access or any Database that is protected with a password ?

    A protected Database with password can connect with a Crystal Reports *.Rpt report using this code :

  • The next part#7 we will discuss creating an EXE of the current project to run it on our windows desktop for personal use.

Part (7) - Building Visual Basic 6.0 desktop application

Thanx for reading, please feel free to leave a suggestion.

Labels :

Visual Basic, learning visual basic, visual basic training, visual basic for dummies, learn visual basic 2010, visual basic classes, visual basic coding, learn visual basic programming, learn visual basic online, visual basic programmer, visual basic help, help with visual basic, visual basic programming help, visual basic 2010 help, microsoft visual basic help, microsoft visual basic 6.0 help, vb programmers, Visual Basic 6.0, visual basic 6.0 software, visual basic 6.0 training, learn visual basic 6.0, ms visual basic 6.0, visual basic 6.0 pro, visual basic 6.0 learning edition, software of visual basic 6.0, how to learn visual basic 6.0, learning visual basic 6.0, visual basic 6.0 price.