Wednesday, September 30, 2009

Creating VB database applications using ADO control

In this sample, you will create a ADO database application to manage your home library.  First of all, create a database in MS Access and name home_Library. In this database, create a table with the following field names;

Title:
Author:
Publisher:
Year:
Category:
and save the table as booktitle.mdb

Design the Interface as follow:

Key in the codes as follows:
Private Sub cmdCancel_Click()
txtTitle.Text = ""
txtAuthor.Text = ""
txtPublisher.Text = ""
txtYear.Text = ""
txtCategory.Text = ""
End Sub

Private Sub cmdDelete_Click()
Confirm = MsgBox("Are you sure you want to delete this record?", vbYesNo, "Deletion Confirmation")
If Confirm = vbYes Then
adoLibrary.Recordset.Delete
MsgBox "Record Deleted!", , "Message"
Else
MsgBox "Record Not Deleted!", , "Message"
End If
End Sub

Private Sub cmdExit_Click()
End
End Sub

Private Sub cmdNew_Click()
adoLibrary.Recordset.AddNew
End Sub

Private Sub cmdNext_Click()
If Not adoLibrary.Recordset.EOF Then
adoLibrary.Recordset.MoveNext
If adoLibrary.Recordset.EOF Then
adoLibrary.Recordset.MovePrevious
End If
End If
End Sub

Private Sub cmdPrevious_Click()
If Not adoLibrary.Recordset.BOF Then
adoLibrary.Recordset.MovePrevious
If adoLibrary.Recordset.BOF Then
adoLibrary.Recordset.MoveNext
End If
End If
End Sub

Private Sub cmdSave_Click()
adoLibrary.Recordset.Fields("Title") = txtTitle.Text
adoLibrary.Recordset.Fields("Author") = txtAuthor.Text
adoLibrary.Recordset.Update
End Sub

Using Crystal Reports in VB

The crystal report writer is an add-in program that comes with visual basic. You use the Crystal Report Writer to create custom reports, lists, labels and form letters using datga from an existing database. However, most of the time- the Crystal Report Writer is used to create reports.

The crystal report writer can be used with the following programs:
  • Microsoft Access
  • dBase
  • Paradox
  • FoxPro
  • Clipper
  • Btrieve
  • SQL Server (via ODBC)
To access the crystal report writer (in visual basic 6.0) click on Add-Ins --> Report Designer. This will take you into Crystal Reports.

CREATING A REPORT:
To create a report, open crystal report writer...
  1. click on File --> New (a Create New dialog will appear).
  2. click on the Standard icon (the Create Report Expert dialog box appears).
  3. click on Datafile (the Choose Database File dialog box appears).
To the left you will see a list of files. To the right is the path showing the folder tree, indicating where the file will be stored.
  1. Click on the file you want to open
  2. Click on Add
  3. Click on Done (the Choose Database File dialog box disappears).
SELECTING FIELDS:
Click on 2: FIELD in the create report expert dialog box. This is where you select the fields that you want to appear in your report. You can select the fields individually by clicking on them and then clicking on ADD, or you can click on ALL, which will select all fields. When a field has been selected, it will be displayed in the REPORT FIELDS window.
You can change column headings as well by clicking and highlighting a field in the Report Fields window, and moving down and typing a new heading for that field. Default headings will appear for each field.

SORTING FIELDS:

Click on 3: SORT tab in the Create Report Expert dialog box. Now select the field you want to have the records sorted by (the selected field will be used to sort all of the records in order by the field selected when the report is produced). You can also set the order to have the table sort in descending order by clicking on the array. Ascending order is the default.

TOTALS AND SUBTOTALS:
Your report has the ability to calculate totals for numeric fields. You can add additional fields by clicking the field and then click the add button. And to delete fields, click on the remove button.
Click on 4: TOTAL tab in the Create Report Expert dialog box. Select field by clicking on it to highlight it. This will create subtotals for that field, and will create section breaks in your report for each record and display a total for the selected field. Now click on the Add button, and this will add the field on the right hand side.
Note: if the check box in the lower right-hand corner is checked, you will get grand totals for your report.
FONTS AND FONT SIZE:
If you would like to adjust the font and font size of your report, first select the field you want to change by clicking on it. And if you want to change more than one, hold the CONTROL key and select the fields you want to change. Now click the arrow to the right of the font window, a drop down menu will appear. Select the font you want by clicking on it to highlight it. And click the arrow to the right of the font size, a drop down menu will appear- and select the font size you want by highlighting it.
SPEEDING UP PROCESSING:
This section is used often if you have large files and want conditions set on the key field or other fields in the file where only certain records will be selected for printing. Setting some keys in this section will speed up processing of records for your report since several records will be skipped.
Click on 5: SELECT tab in the Create Report Expert dialog box. Next, click on SPEED TIP button. This will discuss how records will be selected and how reports will be sped up, if not all records will be used for processing. Now click on OK when finnished reading. Click ADD to add the highlighted field to the Select Fields list box.
The highlight button appears next to the key field in the Report Fields list box. This is because the table contains an index for this field. The key field is often used for filtering out records.
At the bottom of the window, there are two other list boxes, one containing the word "is" and the other containing the words "any value". These two list boxes are used to set conditions to filter out records when producing your report.

DETERMINING THE STYLE:

Click on 6: STYLE tab in the Create Report Expert dialog box. On the left will be a list of styles that you can choose your report to appear in. Click on the one you want. Enter a title for your report by typing it in where it says TITLE at the tob of the Select Fields List Box.
PREVIEWING YOUR REPORT:
To preview the 'final product' simply click PREVIEW REPORT. This will take you to your preview screen showing teh actual report that you have created. There are two modes you can look at in preview report, DESIGN mode and PREVIEW mode.
DESIGN SECTION:
The design section shows the layout of each field in the report, along with titles, headings and totals. You can change the position of a field, making it longer or shorter by clicking on it. You can also change the font and font size of that field.
The design tab contains six sections, as described below...
  1. Title -- Contains information you want to display on the first page only.
  2. Page Header -- Specifies information such as the report title, field headings, and the date.
  3. Details -- Contains the body of the report, database records and subtotals (if you include them).
  4. Grand Total -- Shows the grand totals of all numeric fields talked about in "Totals and Subtotals" above. This section will only appear if you included a grand total in your report.
  5. Page Footer -- Contains page number and any other information you want to appear at the bottom of the page.
  6. Summary -- Contains information you want to appear on the last page only.

Monday, September 28, 2009

How to Make a Perfect Thesis Proposal

Thesis proposal is a paper that aims to provide your suggestions on research you intend to conduct. To write a good thesis proposal, you should think over every issue very carefully and state your thoughts about it on paper.

Making good and qualitative thesis proposals requires being aware of what steps to take. That is why we are eager to present you these steps:

* Choose the problem under consideration. It can be any problem, hypothesis or research question that has never been considered before. Formulate the topic of your thesis proposal;
* Think why your research will be important. Mind that your thesis proposal is a kind of admission to conducting your research. If you do not manage to convince your supervisor in its significance, you may be not allowed to investigate the topic of your thesis proposal chosen;

* Get to know about the prior research of your topic. Perhaps, anyone has touched upon your problem, but it was not covered fully. Tell about it in your thesis proposal;
* Choose the most feasible and applicable methods. It is extremely important for your thesis proposal to present the chosen methodology clearly and comprehensibly, as you are being awaited to demonstrate your research abilities. You can reveal them only by means of applicable methods of investigation;
* Tell about the possible outcomes of your research. In this part of your thesis proposal you should also explain the importance of the results obtained.

In spite of everything, the most challenging task is the choice of your thesis proposal topic. Your research starts with it. That is why you have to try your best to choose the most exclusive and unique topic for your thesis proposal that would give promise of extended study.

Thursday, September 24, 2009

Function in C++

What is a ?

A is a block of code that has a name and it has a property that it is reusable i.e. it can be executed from as many different points in a C Program as required.
groups a number of program statements into a unit and gives it a name. This unit can be invoked from other parts of a program. A computer program cannot handle all the tasks by it self. Instead its requests other program like entities – called functions in C – to get its tasks done. A is a self contained block of statements that perform a coherent task of same kind
The name of the is unique in a C Program and is Global. It neams that a can be accessed from any location with in a C Program. We pass information to the called arguments specified when the is called. And the either returns some value to the point it was called from or returns nothing.
We can divide a long C program into small blocks which can perform a certain task. A is a self contained block of statements that perform a coherent task of same kind.

Structure of a

There are two main parts of the . The header and the body.
int sum(int x, int y)
{
 int ans = 0;  //holds the answer that will be returned
 ans = x + y; //calculate the sum
 return ans  //return the answer
}

Header

In the first line of the above code
int sum(int x, int y)
It has three main parts
  1. The name of the i.e. sum
  2. The parameters of the enclosed in paranthesis
  3. Return value type i.e. int

Body

What ever is written with in { } in the above example is the body of the .

Prototypes

The prototype of a provides the basic information about a which tells the compiler that the is used correctly or not. It contains the same information as the header contains. The prototype of the in the above example would be like
int sum (int x, int y);
The only difference between the header and the prototype is the semicolon ; there must the a semicolon at the end of the prototype.

Fahrenheit to celsius conversion












CSE 112 Answer to your assignment.
formula:
for -- Celsius=(5/9) * (Farenheit - 32)

for -- Farenheit =(9/5) * ( Celcius + 32)

Wednesday, September 23, 2009

for loop statements

CSE 112 Students!!! please review this for loop statement click the url address below.

http://www.hitmill.com/programming/cpp/forLoop.htm

Friday, September 11, 2009

CS 417 Students

Reminder!!!
  1. pass your documentation on pre-final exam.
  2. documentation defense will on sept. 26 - oct 3, oct 10, oct 17
  3. please be guided with your documentation format.
  4. prepare 3 copies for the panelist.
  5. prepare 1 for your reference.
  6. prepare powerpoint for your presentation .
  7. pass before sept. 26, 2009 including your contri.
gudluck!!!