Visual Basic 6 Sample Code and Project
ADO_and_SQL -This sample code of ADO and SQL using the class instead of ADO built-in component.
Payroll Program – Sample payroll program in visual basic 6, calculate hours, overtime, taxes and after taxes computation.
Geometry Calculator- Geometry calculator is a visual basic 6 program that calculates the area and volume.
Vb E-mail Application- How to send and receive email via visual basic program. Mail Application uses the control MAPI Messages and MAPI Session to retrieve and send email.
Digital Clock -VB Calendar program is programatically create calendar application without using the component of built-in date picker.
Digital Clock- Digital clock create an icon on system tray, always on top properties and call the sound system property.
Personal Phone Book-This personal phone book system stores and retrieve data information firstname, last name, address, country, email address etc.
Visual Basic Inventory- Sample inventory program required a crystal report 8.5.
Chat- Chat application using visual basic 6 with this sample you can create other than chat application like for example internet cafe monitoring system you can lock/unlock client, shutdown computers remotely by sending commands.
'This code will automatically sort the data when user click specified the datagrid header.
Private Sub dg1_HeadClick(ByVal ColIndex As Integer)
Adodc1.Recordset.Sort = dg1.Columns(ColIndex).DataField
End Sub
'This code will unload the form when user hit the escape key.
'Note: Form Property Keypreview should be set to TRUE otherwise will not work properly.
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then Unload Me
End Sub
'This code will focus next tab index when user hit the enter key.
Private Sub text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then sendkeys "{tab}"
End Sub
‘—-Sample Search Data with ADODC —–
Function Search_Data()
On Error GoTo errHandler
Dim mSQL$
mSQL = “Select Code,Name,Address From Supplier Where Code Like ‘%” & text1 & “%’ Or Name Like ‘%” & text1 & “%’ ” & _
” Or Address Like ‘%” & t & “%’ Order by Name Asc ”
Adodc1.ConnectionString = ConStr
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = mSQL
Set dg1.DataSource = Adodc1
cmdOK.Enabled = True
Adodc1.Refresh
If Adodc1.Recordset.BOF And Adodc1.Recordset.EOF Then
cmdOK.Enabled = False
End If
Exit Function
errHandler:
MsgBox CStr(Err.Number) + Err.Description
End Function
Pingback: Vb codes for search and edit - iSTORYA.NET
How do u search records in multiple database in just one datagrid?