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
(5) Source code of the applicatin
- Connecting to Microsoft Access 2003 through Microsoft Visual Basic 6.0 and then create a report for it is an easy task even for a beginners whether using the connectiong wizard or using the code, all you need is a practise. We will now connect the database we designed with the application project that we designed using the ADO2.8 techonology to connect.
- To created a connection to the MS-Database (MyBook.mdb) let say it's called (CN) where will store the connection string to the MS-Access database, (RS) is a connection variable to store the connection string to the table called (Phones) to Save/Retrieve data. The coding will start from the Module we created called (evry1falls.bas), like this :
- First thing to do when working with database from your application is to make sure that the Database connection is closed (Off) and the table is closed (Off) because we will open both of them only when we try to save and retrieve. We will execute the connection (CN) and (RS) from MainFrm (Form_Load()) event like this :
- To choose a picture for the friend by clicking the Image control using the (Timg Click()) event :
- To save Data into the Database table, we will use this code in the (Cmd_Save Click()) event :
- To reset all the fields of the Textboxs and the Image control, use this code :
- Now, save some names of your friends along with thier Phone numbers and photos from your computer and display them in the (Display.frm) form we created previously.
- From the IDE of the Display.frm form, we wil create the codes of retrieving the data from the database table. We will also have to make sure the connection to the database is Off and the Table connection is Off before openning it, so the Form_Load() event for the form Display.frm will be like this :
- Now, by clicking on the (LstFrnds) control, we want the Data to be successfullt transfered from the Database table onto the form related controls (Textboxs and Image), by using the (LstFrnds Click()) even and the code:
- To update the friends info stored in the database table, use this code in the (CmdUp Click()) event like this :
- To delete a friend from the database table along with its photo by (CmdDel Click()) event using this code :
- Now try the application and eport any bugs. The following Part#6 we will see how to create Crystal Reports report and how to design it and include it in the application and how to write codes for it using the (CmdPrint) button.
Part (6) - Crystal Reports 4.0 for Visual Basic 6.0
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.