Documente Academic
Documente Profesional
Documente Cultură
Practical No. 1
Title: Creating Universal functions for validation purpose.
Write the name of the controls, their properties used and the values set for each property in the
application in your answer sheet.
-1-
Name-:Amol B Rukhe RollNo-338
Practical No.1
Form 1 :
-2-
Name-:Amol B Rukhe RollNo-338
Practical No.1 :
Form 2 :
-3-
Name-:Amol B Rukhe RollNo-338
Practical No. 1
Form 1
-4-
Name-:Amol B Rukhe RollNo-338
Practical No. 1
Form 2
-5-
Name-:Amol B Rukhe RollNo-338
Practical No. 1
Module
End Function
-6-
Name-:Amol B Rukhe RollNo-338
Practical No. 1
Module
txtname.ForeColor = vbBlack
txtname.BackColor = vbWhite
End Function
-7-
Name-:Amol B Rukhe RollNo-338
Practical No. 1
Module
txtname.Text = ""
txtname.SetFocus
Exit Function
End If
-8-
Name-:Amol B Rukhe RollNo-338
Practical No. 1
Module
-9-
Name-:Amol B Rukhe RollNo-338
Practical No. 2
Title: Creating and Handling multiple forms.
Create a project that will produce a summary of amounts due for John's Auto
Repair Shop. Display a splash screen first; then display the main form.
On click of Job Information menu item “Job Information Form” should be displayed. “Job
Information form” must have textboxes for a user to enter the job number, customer name,
amount charged for parts and hours of labour. Include labels for sub total, sales tax and total.
Form has three command buttons for Calculate, Clear and Ok. Calculate
button finds the charges and displays them in label. The tax rate and the
hourly labour charge should be declared as named constants so that they can
be easily modified if either changes. Current charges are Rs. 30 per hour for
labour and 8 percent for the sales tax rate. Sales tax is charged only on parts,
not on labour.
The Clear button clears the text boxes and labels and resets the focus in the
first textbox.
The Ok button hides the job information form and displays the main form.
On click of “About” item, About form should be displayed. About form should have the program
name, programmer’s seat number, version number, a logo/ Small image and Ok button.
Write the name of the controls, their properties used and the values set for each property in the
application in your answer sheet.
- 10 -
Name-:Amol B Rukhe RollNo-338
Practical No.2
Form 1 :
- 11 -
Name-:Amol B Rukhe RollNo-338
Practical No.2
Splash Screen
- 12 -
Name-:Amol B Rukhe RollNo-338
Practical No.2
Form 1 :
- 13 -
Name-:Amol B Rukhe RollNo-338
Practical No.2
MDIForm :
Splash Screen :
Option Explicit
- 14 -
Name-:Amol B Rukhe RollNo-338
Practical No. 3
Title: To Manipulate the Access database using VB ADODC
Create a database file “library” in Microsoft Access. The structure of table “Books” is as follows:
Fields Data types
ISBN Text
Title Text
Author Text
Publisher Text
Subject_code Text
Shelf Text
Fiction Yes/No
Step 1. Create a new form large enough to hold the controls.
Step 2. Click on data control tool and draw a data control along the bottom of the form.
Step 3 Create a large frame to hold the labels and text boxes then delete the frame’s caption
property.
Step 4. Create text boxes for ISBN, title, authors & publishers.
Step 5 Create combo boxes for subject code and shelf and Checkbox for fiction.
Step 6. Add following elements to the list property of subject_code.(ctrl + enter after each)
List: BSS, FNT, RLG, RMN, HMR, SCF, SLH, BSF, PHL, EDC, MST, BSN
Step 7 Add the following elements to the list property of shelf. (ctrl+enter after each)List:
RC1111, RC1112, RC1113.
Step 8 Add buttons for add, delete and navigating the records.
Step 9. The errors can be minimized by limiting user
actions.
E.g. when the user clicks on the add button several actions should occur.
i. An AddNew method clears the bound control to await entry of new data.
ii. The focus is set in the first text box.
iii. The navigation button and delete buttons are disabled.
iv. The save button enabled.
v. The caption of add button changes to cancel, which gives user only two
choices save and cancel.
Step 10. Use error handlers for some other errors.
Write the name of the controls, their properties used and the values set for each property in your
answer sheet.
Practical No.3
- 15 -
Name-:Amol B Rukhe RollNo-338
Form Design 1 :
Practical No.3
- 16 -
Name-:Amol B Rukhe RollNo-338
Form 1
Practical No.3
- 17 -
Name-:Amol B Rukhe RollNo-338
Form 1
Practical No.3
- 18 -
Name-:Amol B Rukhe RollNo-338
Form 1
Practical No.3
- 19 -
Name-:Amol B Rukhe RollNo-338
Module1
Practical No.3
- 20 -
Name-:Amol B Rukhe RollNo-338
Module1
End Function
- 21 -
Name-:Amol B Rukhe RollNo-338
Practical No. 4
Title: To Manipulate the Oracle database using VB ADODB
Design a code to make table “Animal“ in Oracle with the help of ADODB object.
Modify the above program to provide facility to (Use ADODB Command Object)
• Add a record
• Modify a record
• Delete a record
To the existing program, add five buttons to provide the facility of (Use ADODB Recordset
Object)
• Move to next record
• Move to previous record
• Move to first record
• Move to last record
• Query
o Enter the name to get the corresponding details.
Write the name of the controls, their properties used and the values set for each property in your
answer sheet.
- 22 -
Name-:Amol B Rukhe RollNo-338
Practical No. 4
Form 1 :
- 23 -
Name-:Amol B Rukhe RollNo-338
Practical No. : 4
Form1 :
- 24 -
Name-:Amol B Rukhe RollNo-338
Practical No. : 4
Form1 :
End Sub
rs.Open "Select * from ANIMAL1 where ANIMAL_ID = '" & txtanimalid.Text & "'", con,
adOpenDynamic, adLockOptimistic
Else
rs!Animal_id = txtanimalid.Text
rs!Name = txtname.Text
rs!Height = txtheight.Text
rs!Weight = txtweight.Text
- 25 -
Name-:Amol B Rukhe RollNo-338
Practical No. : 4
Form1 :
rs!AGE = txtage.Text
rs!Color = txtcolor.Text
rs!Texture = txttexture.Text
rs.Update
MsgBox "RECORD ENTERED"
rs.Close
Call disablebutton1(True, True, True, True, True)
Call disablebutton2(True, True, True, True, True)
cmdmodify.Caption = "MODIFY"
End If
End Sub
End If
End Sub
- 26 -
Name-:Amol B Rukhe RollNo-338
Practical No. : 4
Form1 :
con.Provider = "Microsoft.Jet.OLEDB.4.0"
con.ConnectionString = "Data Source=D:\Documents and
Settings\Administrator\Desktop\Tybsc2008\VISUAL BASIC\pract4\animal.mdb"
con.Open
If con.State = adStateOpen Then
MsgBox "CONNECTION ESTABLISHED"
End If
rsnav.Open "select * from ANIMAL1", con, adOpenDynamic, adLockOptimistic
Display
End Sub
Public Sub Display()
End Sub
Call Ucas(txtanimalid)
End Sub
- 27 -
Name-:Amol B Rukhe RollNo-338
Practical No. : 4
Form1 :
- 28 -
Name-:Amol B Rukhe RollNo-338
Practical No. : 4
Module1 :
- 29 -
Name-:Amol B Rukhe RollNo-338
Practical No. : 4
Module1 :
End Function
- 30 -
Name-:Amol B Rukhe RollNo-338
Practical No. 5
Title: Creating and modifying text files from VB.
In the File menu, on click of “New” menu-item textbox should be cleared, “Open” menu-item
should display an open dialog box and user should select a.txt file to display its contents in a
textbox, “Save” menu-item saves the contents of the textbox in the file and “Exit” menu-item
stops the application.
In the Edit menu, on click of “Cut” menu item the selected text from the textbox should be cut,
“Copy” menu-item copies the selected contents, “Paste” menu-item pastes the selected contents
at the cursor position, “Set Font” menu-item will open a font dialog box, the user will select a
font from that font dialog box and then that font should be applied to the whole text.
About form should have the program name, programmer’s seat number, version number and a
logo/Small image and Ok button.
Write the name of the controls, their properties used and the values set for each property in the
application in your answer sheet.
- 31 -
Name-:Amol B Rukhe RollNo-338
Practical No. : 5
Form1 :
- 32 -
Name-:Amol B Rukhe RollNo-338
Practical No. : 5
Form1 :
- 33 -
Name-:Amol B Rukhe RollNo-338
Practical No. : 5
Form1 :
End If
End Sub
End Sub
- 34 -
Name-:Amol B Rukhe RollNo-338
Practical No. 6
Title: Creating and handling Multiple Document Interface Forms
Both data entry screen should contain Add, Update, and Delete command buttons to add a new
record, to modify a record & to delete a record from the database respectively. The same screen
is used for the viewing the data. Add appropriate navigation option on the form.
Write the name of the controls, their properties used and the values set for each property in your
answer sheet.
- 35 -
Name-:Amol B Rukhe RollNo-338
Practical No. 6
Form1
- 36 -
Name-:Amol B Rukhe RollNo-338
Practical No. 6
Form2
- 37 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Crystal Report: Department Wise Employee Report
- 38 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Crystal Report: Employee Report Based On Salary Range
- 39 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Crystal Report: Job Wise
- 40 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Crystal Report: Department Wise salary Report
- 41 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Crystal Report: Job Wise Maximum Salary Report
- 42 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Crystal Report: Employee’s Service Report
- 43 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Form 1
- 44 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Form 1
- 45 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Form 1
ClearAll
End Sub
- 46 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Form 1
- 47 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Form 1
txtename = rsemp(1).Value
txtsal = rsemp(2).Value
txtjob = rsemp(3).Value
cmbDeptNo = rsemp(4).Value
End Sub
- 48 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Form 1
rs.MoveNext
Wend
rs.Close
Fill_EmpNo_List
End Sub
- 49 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Form 2
- 50 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Form 2
Exit Sub
End If
rs.MoveNext
Wend
rs.Close
- 51 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Form 2
rsdept.Delete
Display
End If
End Sub
End Function
- 52 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Form 2
- 53 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Form 2
txtloc = rs(2).Value
End If
End Sub
- 54 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
MDIForm1
- 55 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
MDIForm1
End Sub
- 56 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Module1
For i = 1 To ttvalue.Count
j=i-1
rs.Fields(j) = ttvalue.Item(i)
Next i
rs.Update
End Function
End Function
- 57 -
Name-:Amol B Rukhe RollNo-338
Practical No.6
Module1
frmdepartment.cmdadd.Enabled = badd
frmdepartment.cmddelete.Enabled = bdel
frmdepartment.cmdmodify.Enabled = bmod
frmdepartment.cmdsearch.Enabled = bsearch
frmdepartment.cmdcan.Enabled = bcan
End Function
End Sub
End Function
End Sub
- 58 -
Name-:Amol B Rukhe RollNo-338
Practical No. 7
Title: Displaying and manipulating data from a MSFlexGrid
Write a program to display client information in to a MSFlexGrid. Validate the data and trap the
errors. After entering or updating the data in the database the updated records should be
displayed in the MSFlexGrid.
Write the name of the controls, their properties used and the values set for each property in the
application in your answer sheet.
- 59 -
Name-:Amol B Rukhe RollNo-338
Practical No. 7
Form1
- 60 -
Name-:Amol B Rukhe RollNo-338
Practical No. 7
Form1
- 61 -
Name-:Amol B Rukhe RollNo-338
Practical No. 7
Form1
End Sub
flxClientData.Row = flxClientData.RowSel
flxClientData.Col = 0
txtName = flxClientData.Text
flxClientData.Col = 1
txtPerson = flxClientData.Text
flxClientData.Col = 2
txtAddress = flxClientData.Text
flxClientData.Col = 3
txtNumber = flxClientData.Text
flxClientData.Col = 4
txtEmail = flxClientData.Text
- 62 -
Name-:Amol B Rukhe RollNo-338
Practical No. 7
Form1
End Sub
con.Provider = "Microsoft.jet.OLEDB.4.0"
con.ConnectionString = "data source=D:\TYBSC_2008\vb1\P7\ClientInfo.mdb"
con.Open
If con.State = adStateOpen Then
MsgBox "Connection Established"
End If
rsnav.Open "select * from ClientInfo", con, adOpenDynamic, adLockOptimistic
fraClient_Info.Enabled = False
Call NameGrid(0, 0, "CompanyName ", 2000, flxClientData)
Call NameGrid(1, 0, "ContactPerson", 2000, flxClientData)
Call NameGrid(2, 0, "CompanyAddress", 2000, flxClientData)
Call NameGrid(3, 0, "ContactNumber ", 1500, flxClientData)
Call NameGrid(4, 0, "EmailAddress", 2000, flxClientData)
Call AddtoGrid("ClientInfo", flxClientData, 4)
End Sub
- 63 -
Name-:Amol B Rukhe RollNo-338
Practical No. 7
Module1
- 64 -
Name-:Amol B Rukhe RollNo-338
Practical No. 7
Module1
- 65 -
Name-:Amol B Rukhe RollNo-338
Practical No. 8
Title: Understanding and using OLE and DLL
Write a program to embed Microsoft word into your application. Link any of the other objects
with your application.
On click of start word button start Microsoft Word and on click of stop button end your
Microsoft word.
Write a program to create Dynamic Link Libraries (DLL) for finding sum of two numbers.
Create a project, which uses this DLL, which accepts two numbers and returns the answer.
Write the name of the controls, their properties used and the values set for each property in the
application in your answer sheet.
- 66 -
Name-:Amol B Rukhe RollNo-338
Practical No.8
Part I
Form1
- 67 -
Name-:Amol B Rukhe RollNo-338
Practical No.8
Part II
Form2
- 68 -
Name-:Amol B Rukhe RollNo-338
Practical No.8
Part I
Form1
- 69 -
Name-:Amol B Rukhe RollNo-338
Practical No.8
Part II
Form2
- 70 -
Name-:Amol B Rukhe RollNo-338
Practical No.8
Part II
Class1
- 71 -
Name-:Amol B Rukhe RollNo-338
Practical No. 9
Title: Understanding and using Drag and Drop
Create a project for a card-suit guessing game. The user will drag the images to the boxes along
the lower edge of the form. When the correct image is placed in a box, make the image remain
there.
Then all four images are in the correct location, display a message box congratulating the user.
The reset button should replace the suit images at the top form and clear out the lower boxes.
Write the name of the controls, their properties used and the values set for each property in the
application in your answer sheet.
- 72 -
Name-:Amol B Rukhe RollNo-338
Practical No.9
Form1
- 73 -
Name-:Amol B Rukhe RollNo-338
Practical No.9
Form1
If r = 2 Then
imgClub1.Left = 5760
imgHeart1.Left = 4005
imgSpade1.Left = 2280
imgDiamond1.Left = 480
End If
- 74 -
Name-:Amol B Rukhe RollNo-338
Practical No.9
Form1
If r = 3 Then
imgClub1.Left = 2280
imgHeart1.Left = 480
imgSpade1.Left = 5760
imgDiamond1.Left = 4005
End If
End Sub
End Sub
- 75 -
Name-:Amol B Rukhe RollNo-338
Practical No.9
Form1
- 76 -