Monday 4 April 2016

Create,Save,Update,Delete and Search Student Profile Using Visual Basic ...

How to create ,Save,Update ,Delete and Search Student Profile information using Visual basic and Ms Access-Step By Step
VB6 Control used are Textbox,  OptionBox,Combobox,Picturebox,DatePicker ,Common Dialog controls
Features of Application are:
1.How to design the VB form and add various controls i.e Textbox,  OptionBox,Combobox,Picturebox,DatePicker ,Common Dialog controls onto the form.
2.How to create database object at run time and do the database connectivity.
3.How to load the image onto the form using commondialog control and also  Save /Retrieve  the Image or Picture from the database.
4.How to save the values selected from Optionbox and Combobox into the database and retrieve them when required.
5.How to Use datepicker control and Save the Date into the Database.
6.How to Save ,Delete,Update and Search the Student profiles.
7.How to navigate between the profiles (First/Next/Previous/Last).

if you like my work,Please hit like button and SUBSCRIBE to my channel.

CODE FOR THIS APPLICATION:

Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim str As String
Dim confirm As Integer

CODE FOR ADD NEW PROFILE
Private Sub addnew_Click()
rs.addnew
clear
End Sub
Sub clear()
Text1.Text = ""
Text2.Text = ""
DTPicker1.Value = "10/05/2005"
Option1.Value = False
Option2.Value = False
Combo1.Text = "Select Department"
Combo2.Text = "Select Course"
Combo3.Text = "Select Semester"
Text3.Text = ""
Text4.Text = ""
Picture1.Picture = LoadPicture("")
End Sub
CODE FOR COMBOBOX SELECT OPTIONS
Private Sub Combo1_Click()
Combo2.clear
If Combo1.Text = "Computer Science" Then
Combo2.AddItem "M.C.A"
Combo2.AddItem "B.C.A"
Combo2.AddItem "B.Sc(IT)"
ElseIf Combo1.Text = "Electrical Engineering" Then
Combo2.AddItem "B.TECH (EE)"
Combo2.AddItem "M.TECH (EE)"
ElseIf Combo1.Text = "Civil Engineering" Then
Combo2.AddItem "B.TECH (CE)"
Combo2.AddItem "M.TECH (CE)"
Else
End If
End Sub
CODE FOR DELETE BUTTON
Private Sub deletebtn_Click()
confirm = MsgBox("Do you want to delete the Student Profile", vbYesNo + vbCritical, "Deletion Confirmation")
If confirm = vbYes Then
rs.Delete adAffectCurrent
MsgBox "Record has been Deleted successfully", vbInformation, "Message"
rs.Update
refreshdata
Else
MsgBox "Profile Not Deleted ..!!", vbInformation, "Message"
End If

End Sub
Sub refreshdata()
rs.Close
rs.Open "Select * from ProfileTBL", con, adOpenStatic, adLockPessimistic
If Not rs.EOF Then
rs.MoveNext
display
Else
MsgBox "No Record Found"
End If
End Sub
CODE FOR SEARCH PROFILE:
Private Sub findbtn_Click()
rs.Close
rs.Open "Select * from ProfileTBL where RollNo='" + Text1.Text + "'", con, adOpenDynamic, adLockPessimistic
If Not rs.EOF Then
display
reload
Else
MsgBox "Record Profile not found ..!!", vbInformation
End If

End Sub
Sub reload()
rs.Close
rs.Open "Select * from ProfileTBL", con, adOpenDynamic, adLockPessimistic
End Sub
Database Connectivity under FORM LOAD
Private Sub Form_Load()
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Database Folder\ProfileDB.mdb;Persist Security Info=False"
rs.Open "Select * from ProfileTBL", con, adOpenDynamic, adLockPessimistic

Combo1.AddItem "Computer Science"
Combo1.AddItem "Electrical Engineering"
Combo1.AddItem "Civil Engineering"
Combo3.AddItem "SEMESTER-I"
Combo3.AddItem "SEMESTER-II"
Combo3.AddItem "SEMESTER-III"
Combo3.AddItem "SEMESTER-IV"
Combo3.AddItem "SEMESTER-V"
Combo3.AddItem "SEMESTER-VI"
Combo3.AddItem "SEMESTER-VII"
Combo3.AddItem "SEMESTER-VIII"
display
End Sub
Sub display()
Text1.Text = rs!Rollno
Text2.Text = rs!Name
DTPicker1.Value = rs!DOB
If rs!Gender = "MALE" Then
Option1.Value = True
Else
Option2.Value = True
End If
Combo1.Text = rs!Dept
Combo2.Text = rs!Course
Combo3.Text = rs!Semester
Text3.Text = rs!Address
Text4.Text = rs!phone
Picture1.Picture = LoadPicture(rs!photo)
End Sub
CODE FOR RECORD NAVIGATION
Private Sub Firstbtn_Click()
rs.MoveFirst
display
End Sub

Private Sub lastbtn_Click()
rs.MoveLast
display
End Sub

Private Sub nextbtn_Click()
rs.MoveNext
If Not rs.EOF Then
display
Else
rs.MoveFirst
display
End If
End Sub

Private Sub Previousbtn_Click()
rs.MovePrevious
If rs.BOF Then
rs.MoveLast
display
Else
display
End If
End Sub
CODE FOR SAVE PROFILE
Private Sub savebtn_Click()
rs.Fields("RollNo").Value = Text1.Text
rs.Fields("Name").Value = Text2.Text
rs.Fields("DOB").Value = DTPicker1.Value
If Option1.Value = True Then
rs.Fields("Gender") = Option1.Caption
Else
rs.Fields("Gender") = Option2.Caption
End If
rs.Fields("Dept").Value = Combo1.Text
rs.Fields("Course").Value = Combo2.Text
rs.Fields("Semester").Value = Combo3.Text
rs.Fields("Address").Value = Text3.Text
rs.Fields("Phone").Value = Text4.Text
rs.Fields("Photo").Value = str
MsgBox "Data is saved successfully ..!!!", vbInformation
rs.Update
End Sub
CODE FOR UPDATE PROFILE
Private Sub updatebtn_Click()
rs.Fields("RollNo").Value = Text1.Text
rs.Fields("Name").Value = Text2.Text
rs.Fields("DOB").Value = DTPicker1.Value
If Option1.Value = True Then
rs.Fields("Gender") = Option1.Caption
Else
rs.Fields("Gender") = Option2.Caption
End If
rs.Fields("Dept").Value = Combo1.Text
rs.Fields("Course").Value = Combo2.Text
rs.Fields("Semester").Value = Combo3.Text
rs.Fields("Address").Value = Text3.Text
rs.Fields("Phone").Value = Text4.Text
MsgBox "Data is updated successfully ..!!!", vbInformation
rs.Update
End Sub
CODE FOR LOADING PICTURE
Private Sub uploadbtn_Click()
CommonDialog1.ShowOpen
CommonDialog1.Filter = "Jpeg|*.jpg"
str = CommonDialog1.FileName
Picture1.Picture = LoadPicture(str)
End Sub

Here is my updated List of Tutorials.
Advance Login System (Splash Screen with Progress Bar,User Registration,Login system,Welcome )   https://youtu.be/s-BU03egpWA
Add Delete Update Search https://youtu.be/K8jq2H3aamk
Data Report in VB6   https://youtu.be/vjQDtKMUCKk
Data Manager in VB6  https://youtu.be/27IrMsEXlBc
Create Tool Bar,Status Bar and Menu Bar   https://youtu.be/3l6bciTAC7Q
Common dialog control- Font and Color Dialog   https://youtu.be/4DBy2ghmu7U
Search Records in Database (By Name or ID)  https://youtu.be/1yNScTVAqZ4
Login Form using Visual Basic 6.0  https://youtu.be/XXKjfta5kkg
Add Delete Update and Clear records  https://youtu.be/tYS7uncH8Ds
Simple Visual Basic Database  Application  https://youtu.be/PldGe0-FnI8
Design Font Dialog Box in VB 6  https://youtu.be/C0CMtoXIFY4
Road Traffic lights Animated system https://youtu.be/74Zvl0bXeAY
ListBox Control( Advanced)  https://youtu.be/Q6NYtmH7z9Q
ListBox Control -Add,Delete and Clear items https://youtu.be/YlmKSyk0l2k
Custom Progress Bar with percentage completed on Splash Screen  https://youtu.be/jGSxrhYZAbE
Frame Control,Check Box and Option Buttons https://youtu.be/9x9dmM0V4CU
Picture Viewer+Browser in Visual Basic  https://youtu.be/POd1Kmpvc0M
Splash Screen with Progress Bar-  https://youtu.be/95hw5z7lq4A
Create Menus,Drop Down Menus ,Nested menus in Menu Bar https://youtu.be/fNtJaQgnuEs

for more about  Visual Basic tutorials,please visit
Youtube Channel:https://www.youtube.com/user/sandydehrian
Computer Gyan Blog:http://selfcomputerlearning.blogspot.in/

Please Share | Support | SUBSCRIBE

33 comments:

  1. Thank You.
    https://www.anilmandal.com.np/

    ReplyDelete
  2. TY
    https://hardi-art.blogspot.com/

    ReplyDelete
  3. HI SIR
    could you please send me the project I would like to develop something really similar to it.
    thanks in advance.

    ReplyDelete
  4. Could please do tutorials on Spreadsheet for the same projects too.
    that would be very helpful.

    ReplyDelete
  5. do you have a tutorial in making function about add, delete, search update in module in visual basic 6 using wampserver

    ReplyDelete
  6. Thank you very much for this!
    This is more than usefull!
    Have a nice day!

    ReplyDelete
  7. Thanks for your channel..
    Very nice... ��

    ReplyDelete
  8. can i use this code on visual studio 2015? Yes or not. Can you send me full source code zip file?

    ReplyDelete
  9. Phone no out of range it's showing

    ReplyDelete
  10. sir could you please send me the project.. please. thank you so much
    ralvuin@gmail.com

    ReplyDelete
  11. Hello. I'm Brazilian, sorry for the language errors. Is your spreadsheet for sale or can you please send it to me? I would like to study it. Follow my email: evaldo.almeidasoares@gmail.com Thank you very much!

    ReplyDelete
  12. Sir can you pls send me the project file to my email It would be very helpful. oisci0435@gmail.com

    ReplyDelete
  13. please can you send me the project @shaq.chidoori@gmail.com

    ReplyDelete
  14. Excellent work done by you sir,
    I am very much happy by seeing your you tube and blog I subscribed also.

    ReplyDelete
  15. Sir I want to contact u how should I it's urgent.. 🙏

    ReplyDelete
  16. Bom dia.
    Gostei muito deste projeto, por favor podes me enviar o projecto.
    xietosambuquila22@gmail.com

    ReplyDelete
  17. sir could you please send me the project.. please. thank you so much mehmetmirdal@hotmail.com

    ReplyDelete
  18. sir could you please send me the project.. please.
    www.mohammadullah.kareemzai@gmail.com
    Please send it to me i am waiting for it thank you very much

    ReplyDelete
  19. Thanks very much sir for all your free tutorials, they have really been helpful to me so far in my computer science career. please sir my major problem is the package and deployment wizard in vb 6.0. anytime i try to package a solution it shows "Unexpected error 429 has occured: ActiveX component can't create object". please sir kindly help out with a solution. here is my email "omoniyishola90@gmail.com" whatsapp "+2347066109170" thanks in anticipation.

    ReplyDelete
  20. sir could you please send me the project.. please. thank you so much
    ferosekhan5767@gmail.com

    ReplyDelete
    Replies
    1. senhor poderia me enviar o projeto.. por favor. muito obrigado
      robsonslz@gmail.com

      Delete
  21. I m grateful to follow you tutorial. I m using to teach my student

    ReplyDelete
  22. Computer Gyan: Create,Save,Update,Delete And Search Student Profile Using Visual Basic ... >>>>> Download Now

    >>>>> Download Full

    Computer Gyan: Create,Save,Update,Delete And Search Student Profile Using Visual Basic ... >>>>> Download LINK

    >>>>> Download Now

    Computer Gyan: Create,Save,Update,Delete And Search Student Profile Using Visual Basic ... >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete
  23. we face any issue regarding its servicing or any technical problem, we try to solve it as soon as possible and that too from well trained professionals. Dell Laptop Service Center will help you come out and give you benefits of high quality service. Their expert technicians ensure that you get all your laptops issues resolved timely and in accost effective manner.

    Dell Laptop Service Center in Noida
    Dell Laptop Service Center in Noida Sector-18
    Dell Laptop Service Center in Noida Sector-62
    Dell Laptop Service Center in Noida Sector-15,16
    Dell Laptop Service Center in Noida Sector-50,51,52

    ReplyDelete
  24. Computers have improved the quality of entertainment. Llimink triple monitor

    ReplyDelete
  25. Why Save button and update button have same code? and when i pressed update the data keep duplicating in my database?

    ReplyDelete