Wednesday, May 19, 2010

HOW TO CALCULATE EMPLOYEE SALARY USING VB. Creating COM Using VB | Component Object Model in Visual BASIC

To create a Component for calculating the employee salary by using VB. Create component Object Model
STEP BY STEP ALGORITHM:
Part-1: ActiveX Control
Building a Simple ActiveX Control in VB
This set of instructions will show you how to build, test and package a trivial ActiveX control. The control is used to calculate the Employee Salary details. The steps are as follows,
1. Open VB 6.0

2. From that select Active-x control then click open.
3. Select add-ins from the main menu select add-in manager. A dialog window will be displayed.
4. Select active-x control interface wizard as loaded and select load as startup. Then click ok
5. Again select add-ins from the main menu. Select active-x control interface wizard. One dialog window will be displayed. In that dialog window click next button.
6. Add a property as salary and also add methods as PF, URA, MR & NET.
7. Click the next button select the data type as double for both property and methods. And finally click the finish button
8. Double click the coding part and type the coding
9. Select the project and run
10. Select file menu select make the project as .ocx save the project and the user control.
Create component Object Model in Visual Basic
Part-2:
Testing your OCX from a new VB project
1. Open VB 6.0
2. Select standard.exe and design the window as shown in the output figure.
3. Select project from the Main menu. From that select components -> select your user control (project name) and then click ok.
4. Place the user control in your designed window.
5. Select the command button and write the proper coding.
Finally run and build your application | component Object Model in Visual Basic
Steps to create data report and data environment:
1. Click components. From that select designer. Then a dialog window displayed in that window select data report & data environment then click add Data Report & Data Environment.
2. Select Add-ins select visual data manager -> select file -> new->select Microsoft access version 7.0 then give a database name then right click the properties click new table give a table name then add the fields (name, salary, city). Finally select Build the table.
3. Select Data Environment. From that right click the connections. Click the properties one dialog window displayed. From that window select Microsoft Jet 3.51 OLE DB providers. Then click next.
4. In the connection tab select your database name, then click test connection a message box will be displayed as Test Connection succeed then click ok. Again In Data Environment, right click connection1 add a command. A new command is added. Now right click the command select properties.
5. In the property window type the SQL statement as select * from your6. Now your fields are added in your command. Then place the fields from Data Environment into Data Report. Then open the property window for Data Report, click data member as your command and then select data source as Data Environment.
7. Then select Data Environment properties. Give the data source and data member.
8. Then write the proper coding.
9. Finally run and build your application.
source code programming
CODING: component object model Source code programming

1. ActiveX Control
Public Property Get salary() As Double
salary = m_salary
End Property

Public Function PF() As Double
PF = m_salary * (8 / 100)
End Function

Public Function URA() As Double
URA = m_salary * (5 / 100)
End Function


Public Function MR() As Double
MR = m_salary * (4 / 100)
End Function

Public Function NET() As Double
NET = Val(m_salary) + Val(PF) + Val(URA) + Val(MR)
End Function

2. Standard Exe
Form 1
Private Sub Command1_Click()
UserControl11.salary = Text3.Text
Text4.Text = UserControl11.PF
Text5.Text = UserControl11.URA
Text6.Text = UserControl11.MR
Text7.Text = UserControl11.NET
End Sub

Private Sub Command2_Click()
Data1.Recordset.AddNew
Data1.Recordset.Fields(0) = Text1.Text
Data1.Recordset.Fields(1) = Text2.Text
Data1.Recordset.Fields(2) = Text3.Text
Data1.Recordset.Update
End Sub

Private Sub Command3_Click()
DataReport1.Show
End Sub

5 comments:

Anonymous said...

These are fundamentally short phrase loans that do produce
you meet your fiscal problems within a desired specific time period.
Thinking about time limitations these loans are particularly developed above an obligation absolutely free platform.

As such, these are kept totally absolutely free from credential checksums.
Issues such as defaults, arrears, bankruptcy, CCJs and
even IVAs are not regarded as here. Further, there are
also no collaterals associated with these loans. There is minimal paper operate needed on the part of borrower.
There are also no hidden or extra documentation or faxing essential
right here. Applying for these loans is also exceptionally practical.
Folks basically need filling an via the internet type and when this
gets authorized money is received inside 24 hours time frame.
These loans are usually supplied beneath handy terms and situations.
The common standard applicant criteria right here is that they will need to be a UK resident and of 18 years
of age.
Also visit my blog post ; vmpbx.com

Anonymous said...

These are fundamentally brief phrase loans that do give you meet your
fiscal difficulties inside a preferred specific time period.
Contemplating time limitations these loans are specifically created above an obligation free platform.
As such, these are kept totally 100 % free from credential checksums. Challenges such as defaults, arrears, bankruptcy, CCJs and even IVAs are not viewed as right here. Further, there are also no collaterals associated with these loans. There is minimal paper operate necessary on the element of borrower. There are also no hidden or additional documentation or faxing required here. Applying for these loans is also exceptionally convenient. People merely need filling an on the web form and when this gets approved cash is received inside 24 hours time frame. These loans are commonly supplied below handy terms and situations. The basic basic applicant criteria right here is that they will need to be a UK resident and of 18 years of age.
Here is my web-site :: www.kopimismchurch.com

Anonymous said...

These are fundamentally short term loans that do give you meet your fiscal challenges within a preferred distinct time period.
Considering time limitations these loans are specifically
made above an obligation free platform. As such, these are kept fully absolutely free
from credential checksums. Issues such as defaults, arrears, bankruptcy, CCJs and even IVAs are not thought to be right here.

Further, there are also no collaterals associated with these loans.
There is minimal paper perform expected on the element of borrower.
There are also no hidden or additional documentation or faxing necessary right here.
Applying for these loans is also quite handy.

Persons just require filling an over the internet form and once this gets
approved money is received within 24 hours time frame. These loans are usually
offered below convenient terms and conditions. The general
standard applicant criteria here is that they will need to be a UK resident and of
18 years of age.
Look at my web-site :: ziing.com

Anonymous said...

These are fundamentally short term loans that do give you meet your fiscal problems inside a
desired precise time period. Thinking about time limitations these
loans are particularly created above an obligation no cost
platform. As such, these are kept totally no cost from credential checksums.
Concerns such as defaults, arrears, bankruptcy, CCJs and even IVAs are not regarded
right here. Additional, there are also no collaterals linked
with these loans. There is minimal paper operate required on the component of borrower.
There are also no hidden or further documentation or faxing needed
right here. Applying for these loans is also really
convenient. People today basically need filling an online form and as soon as this gets authorized money
is received within 24 hours time frame. These loans are often supplied below practical terms and conditions.
The general standard applicant criteria here is that
they ought to be a UK resident and of 18 years of age.
Look at my website :: http://www.partnersforhisglory.org

Anonymous said...

These are basically short phrase loans that do supply you meet
your fiscal issues inside a desired distinct time period.
Thinking of time limitations these loans
are especially made above an obligation zero cost platform.
As such, these are kept completely free from credential checksums.
Troubles such as defaults, arrears, bankruptcy, CCJs and even IVAs are not considered right here.

Additional, there are also no collaterals connected with these loans.
There is minimal paper function necessary on the aspect of
borrower. There are also no hidden or additional documentation or faxing expected here.

Applying for these loans is also extremely convenient.
Persons simply call for filling an online form and when this
gets approved money is received within 24 hours time frame.

These loans are generally supplied below convenient terms
and circumstances. The common simple applicant criteria here is that they should certainly be a UK resident and of 18 years of age.
My site: http://bakeek.com

Flag counter

free counters