Showing posts with label VB 6.0 Sample Program. Show all posts
Showing posts with label VB 6.0 Sample Program. Show all posts
Advance Login Form for System Security
12:40 AM
| Posted by
Unknown
|
PROGRAM DESCRIPTION
This program is an advance login security for your system. add this in your project then you have it 100% working. just dont forget to add the database. you may download the full project source code below for free!!!
SCREENSHOT

CODE
Option Explicit
Public conn As ADODB.Connection
Public Sub connect()
Set conn = New ADODB.Connection
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\myDatabase.mdb;Persist Security Info=False"
End Sub
Sub main()
connect
frmLogin.Show
End Sub
Private Sub cmdCancel_Click()
End
End Sub
Private Sub cmdOK_Click()
Dim rs As New ADODB.Recordset
rs.Open "SELECT * FROM tblUser WHERE username = '" & txtUserName & "'", conn, adOpenStatic, adLockReadOnly
If rs.RecordCount <> 0 Then
If txtPassword = rs!password Then
MsgBox "Username and Password Succesful!"
'Remove msgbox above then call a form to be load if login is succesful!
Else
MsgBox "Invalid Password, try again!", , "Login"
End If
Else
MsgBox "Invalid Login, try again!", , "Login"
End If
rs.Close
Set rs = Nothing
End Sub
This program is an advance login security for your system. add this in your project then you have it 100% working. just dont forget to add the database. you may download the full project source code below for free!!!
SCREENSHOT

CODE
Module
Option Explicit
Public conn As ADODB.Connection
Public Sub connect()
Set conn = New ADODB.Connection
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\myDatabase.mdb;Persist Security Info=False"
End Sub
Sub main()
connect
frmLogin.Show
End Sub
frmLogin
End
End Sub
Private Sub cmdOK_Click()
Dim rs As New ADODB.Recordset
rs.Open "SELECT * FROM tblUser WHERE username = '" & txtUserName & "'", conn, adOpenStatic, adLockReadOnly
If rs.RecordCount <> 0 Then
If txtPassword = rs!password Then
MsgBox "Username and Password Succesful!"
'Remove msgbox above then call a form to be load if login is succesful!
Else
MsgBox "Invalid Password, try again!", , "Login"
End If
Else
MsgBox "Invalid Login, try again!", , "Login"
End If
rs.Close
Set rs = Nothing
End Sub
Labels:VB 6.0 Sample Program
ADD, EDIT, UPDATE, DELETE, SEARCH and NAVIGATION in VB 6.0 to MS ACCESS using ADO
6:45 PM
| Posted by
Unknown
|
PROGRAM DESCRIPTION
This program is capable of the following functionality:
-Add record
-Delete record
-Search and Filter record
-Edit and Update record
-Navigate into record
with Status bar using ADO connection to connect to Microsoft Access Database.
SCREENSHOT
CODE
Option Explicit
Public conn As ADODB.Connection
Public rs As ADODB.Recordset
Sub connect()
Set conn = New ADODB.Connection
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\myDatabase.mdb;Persist Security Info=False"
Set rs = New ADODB.Recordset
rs.ActiveConnection = conn
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
rs.LockType = adLockOptimistic
rs.Source = "SELECT * FROM MyTable"
rs.Open
End Sub
Sub main()
connect
frmMain.Show
End Sub
Private Sub cmdDelete_Click()
On Error Resume Next
If MsgBox("Data is not recoverable!", vbExclamation + vbOKCancel, "Confirm Delete") = vbOK Then
rs.Delete
End If
End Sub
Private Sub cmdFirst_Click()
rs.MoveFirst
Call stat
End Sub
Private Sub cmdLast_Click()
rs.MoveLast
Call stat
End Sub
Private Sub cmdNext_Click()
If rs.EOF = True Then
rs.MoveFirst
Call stat
Else
rs.MoveNext
Call stat
End If
End Sub
Private Sub cmdPrevious_Click()
If rs.BOF = True Then
rs.MoveLast
Call stat
Else
rs.MovePrevious
Call stat
End If
End Sub
Private Sub Command1_Click()
rs.Filter = adFilterNone
rs.Requery
End Sub
Private Sub Command2_Click()
If MsgBox("Close Applect?", vbQuestion + vbYesNo, "Confirm") = vbYes Then
End
End If
End Sub
Private Sub Form_Load()
Set DataGrid1.DataSource = rs
End Sub
Sub stat()
StatusBar1.Panels(1).Text = "Record " & rs.AbsolutePosition & " of " & rs.RecordCount
End Sub
Private Sub mnuAdd_Click()
frmAdd.Show
End Sub
Private Sub cmdSave_Click()
If txtid.Text = "" Or txtFn.Text = "" Or txtMi.Text = "" Or txtLn.Text = "" Then
MsgBox "Some fields are still empty!", vbExclamation, "Input Error"
Else
rs.AddNew
rs("studId") = txtid.Text
rs("FirstName") = txtFn.Text
rs("MI") = txtMi.Text
rs("LastName") = txtLn.Text
rs.Update
MsgBox "Record Added Successfusly!", vbInformation, "Add Record"
Call clear
End If
End Sub
Sub clear()
txtid.Text = ""
txtFn.Text = ""
txtMi.Text = ""
txtLn.Text = ""
txtFn.SetFocus
End Sub
Private Sub txtSearch_Change()
If txtSearch.Text = "" Then
Call Form_Load
Me.Show
Else
rs.Filter = "FirstName LIKE '" & Me.txtSearch.Text & "*'"
Set DataGrid1.DataSource = rs
End If
End Sub
This program is capable of the following functionality:
-Add record
-Delete record
-Search and Filter record
-Edit and Update record
-Navigate into record
with Status bar using ADO connection to connect to Microsoft Access Database.
SCREENSHOT
CODE
MODULE
Option Explicit
Public conn As ADODB.Connection
Public rs As ADODB.Recordset
Sub connect()
Set conn = New ADODB.Connection
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\myDatabase.mdb;Persist Security Info=False"
Set rs = New ADODB.Recordset
rs.ActiveConnection = conn
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
rs.LockType = adLockOptimistic
rs.Source = "SELECT * FROM MyTable"
rs.Open
End Sub
Sub main()
connect
frmMain.Show
End Sub
FORM 1
Private Sub cmdDelete_Click()
On Error Resume Next
If MsgBox("Data is not recoverable!", vbExclamation + vbOKCancel, "Confirm Delete") = vbOK Then
rs.Delete
End If
End Sub
Private Sub cmdFirst_Click()
rs.MoveFirst
Call stat
End Sub
Private Sub cmdLast_Click()
rs.MoveLast
Call stat
End Sub
Private Sub cmdNext_Click()
If rs.EOF = True Then
rs.MoveFirst
Call stat
Else
rs.MoveNext
Call stat
End If
End Sub
Private Sub cmdPrevious_Click()
If rs.BOF = True Then
rs.MoveLast
Call stat
Else
rs.MovePrevious
Call stat
End If
End Sub
Private Sub Command1_Click()
rs.Filter = adFilterNone
rs.Requery
End Sub
Private Sub Command2_Click()
If MsgBox("Close Applect?", vbQuestion + vbYesNo, "Confirm") = vbYes Then
End
End If
End Sub
Private Sub Form_Load()
Set DataGrid1.DataSource = rs
End Sub
Sub stat()
StatusBar1.Panels(1).Text = "Record " & rs.AbsolutePosition & " of " & rs.RecordCount
End Sub
Private Sub mnuAdd_Click()
frmAdd.Show
End Sub
Private Sub cmdSave_Click()
If txtid.Text = "" Or txtFn.Text = "" Or txtMi.Text = "" Or txtLn.Text = "" Then
MsgBox "Some fields are still empty!", vbExclamation, "Input Error"
Else
rs.AddNew
rs("studId") = txtid.Text
rs("FirstName") = txtFn.Text
rs("MI") = txtMi.Text
rs("LastName") = txtLn.Text
rs.Update
MsgBox "Record Added Successfusly!", vbInformation, "Add Record"
Call clear
End If
End Sub
Sub clear()
txtid.Text = ""
txtFn.Text = ""
txtMi.Text = ""
txtLn.Text = ""
txtFn.SetFocus
End Sub
Private Sub txtSearch_Change()
If txtSearch.Text = "" Then
Call Form_Load
Me.Show
Else
rs.Filter = "FirstName LIKE '" & Me.txtSearch.Text & "*'"
Set DataGrid1.DataSource = rs
End If
End Sub
DOWNLOAD HERE: Full Project Source Code Above and Database (ADO connection)
Labels:VB 6.0 Sample Program
Loading Splash Screen using Progress Bar in VB 6.0
10:01 PM
| Posted by
Unknown
|
DESCRIPTION
This vb sample program using a progress bar is use for loading / splash screen on your small application.
download the full source code below for free then try it on your own. enjoy!
SCREENSHOT
CODE
Option Explicit
Private Sub Form_Load()
Timer1.Enabled = True
Timer1_Timer
End Sub
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 10
If ProgressBar1.Value = 80 Then
ProgressBar1.Value = ProgressBar1 + 20
If ProgressBar1.Value >= ProgressBar1.Max Then
Timer1.Enabled = False
End If
'In this are you may call the form to be loaded next!
MsgBox "Loading Complete!", vbInformation, "Info"
Unload Me
End If
End Sub
DOWNLOAD HERE: Loading Splash Screen using Progress Bar in VB 6.0
Labels:VB 6.0 Sample Program
Simple Login / Security in VB 6.0
9:31 PM
| Posted by
Unknown
|
SCREENSHOT
CODE
Option Explicit
Dim user As String
Dim pass As String
Public LoginSucceeded As Boolean
Private Sub cmdExit_Click()
If MsgBox("Are you sure to close this Application?", vbQuestion + vbYesNo, "System") = vbYes Then
End
End If
End Sub
Private Sub cmdLogin_Click()
user = "admin"
pass = "12345"
If txtUserName.Text = user Then
If txtPassword.Text = pass Then
MsgBox "Username and Password Accepted!", vbInformation, "Login"
'You may change this line here. call the form rather than displaying a message box!
ElseIf txtPassword.Text = "" Then
MsgBox "Password Field Empty!", vbExclamation, "Login"
Else
MsgBox "Username and Password not Matched!", vbExclamation, "Login"
End If
ElseIf txtUserName.Text = "" Then
MsgBox "Username Field Empty!", vbExclamation, "Login"
Else
MsgBox "Invalid Username, try again!", , "Login"
txtPassword.SetFocus
End If
End Sub
DOWNLOAD HERE: Simple Login / Security in VB 6.0
CODE
Option Explicit
Dim user As String
Dim pass As String
Public LoginSucceeded As Boolean
Private Sub cmdExit_Click()
If MsgBox("Are you sure to close this Application?", vbQuestion + vbYesNo, "System") = vbYes Then
End
End If
End Sub
Private Sub cmdLogin_Click()
user = "admin"
pass = "12345"
If txtUserName.Text = user Then
If txtPassword.Text = pass Then
MsgBox "Username and Password Accepted!", vbInformation, "Login"
'You may change this line here. call the form rather than displaying a message box!
ElseIf txtPassword.Text = "" Then
MsgBox "Password Field Empty!", vbExclamation, "Login"
Else
MsgBox "Username and Password not Matched!", vbExclamation, "Login"
End If
ElseIf txtUserName.Text = "" Then
MsgBox "Username Field Empty!", vbExclamation, "Login"
Else
MsgBox "Invalid Username, try again!", , "Login"
txtPassword.SetFocus
End If
End Sub
DOWNLOAD HERE: Simple Login / Security in VB 6.0
Labels:VB 6.0 Sample Program
Human Resource and Payroll System
6:08 PM
| Posted by
Unknown
|
This simple Human Resource and Payroll System is for beginners with no Database application. it contains Login form that has 3 user accounts and user level, Splash screen, main form where to find Human Resource Form and Payroll System Form and the additional source code of calculator written in Visual Basic 6.0.
User level - admin - username - admin - password - admin
refer to source code for other username and password.
Download the source code for Free!
Have fun!
User level - admin - username - admin - password - admin
refer to source code for other username and password.
Download the source code for Free!
Have fun!
Labels:VB 6.0 Sample Program
Impress/propose your girl/boy friends
1:59 AM
| Posted by
Unknown
|
Labels:VB 6.0 Sample Program
Bubble Sorting in VB 6.0
1:52 AM
| Posted by
Unknown
|
SCREENSHOT

Description
This simple program demonstrates the Bubble Sort Algorithm. Allowing the end user to text of any length and displays the sorted set of characters. The Program uses one-dimensional array and bubble sort. download the bubble sorting source code below and try it yourself! have fun...
Download Full Project Source Code Here: Bubble Sorting
Description
This simple program demonstrates the Bubble Sort Algorithm. Allowing the end user to text of any length and displays the sorted set of characters. The Program uses one-dimensional array and bubble sort. download the bubble sorting source code below and try it yourself! have fun...
Download Full Project Source Code Here: Bubble Sorting
Labels:VB 6.0 Sample Program
Subscribe to:
Posts
(Atom)




