Professional Documents
Culture Documents
LIBRARY SYSTEM
BY
ANJARIA SAVAN (042102)
CHAUHAN TEJAS (042225)
FOR
COURSE - PROJECT IN VISUAL BASIC
BE COMPUTER ENGINEERING
2006
TO
COMPUTER ENGINEERING DEPARTMENT
ATMIYA INSTITUTE OF TECHNOLOGY AND SCIENCE
RAJKOT
INDIA
ACKNOWLEDGEMENT
CONTENTS
01. ACKNOWLEDGMENT
02. CONTENTS
03. PREFACE
06. OVERVIEW OF LS
09. SUPPORTS
PREFACE
Anjaria Savan
Chauhan Tejas
PROJECT SPECIFICATIONS
Requirements: Platform:
Microsoft Windows 9x, NT and
onwards
Hardware:
32-bit Processor, 300 MHz
32 MB RAM,
Printer
Visual Basic developed from the old Quick Basic language that
was available under the DOS operating system. Quick Basic is
the same language as BASIC; it is just Microsoft's product name
for its version of BASIC. Visual Basic started out as the Brainchild
of Alan Cooper. Cooper developed Visual Basic and then sold the
product to Microsoft. Microsoft took the undeveloped product,
code-named it "Thunder," the proceeded to create a
programming language that would soon become one of the
premier development environments in the windows environment.
1. ActiveX documents.
2. DHTML applications that help you test browser
application.
3. IIS applications that help you build server-based
application.
4. Web browser control.
5. FTP / HTTP support through a custom control.
6. Winsock control.
Has an excellent integrated Help facility and Books Online?
Including good debugging facilities. It has many wizards
that help automate repetitive tasks.
Can be extended easily through the use of Windows API
calls, hundreds of third party controls and DLLs, and
integration with other Windows applications through Com
and DCOM.
Uses many database access methods to get at different
types of data.
Before you can use the ADOCE control in eMbedded Visual Basic,
you must create a reference to the control in the integrated
development environment (IDE). If the control is registered with the
Control Manager, the correct components will be installed when you
run your application on a device. The following procedure shows
how to create a reference to the ADOCE control in the eMbedded
Visual Basic IDE.
Toolbars
If you enable it, users of MFC toolbars can dock them to the edge of
a window or "float" them anywhere within the application window.
MFC doesn’t support customizable toolbars like those in the
development environment.
MFC also supports tool tips: small pop-up windows that describe a
toolbar button's purpose when you position the mouse over the
button. By default, when the user presses a toolbar button, a status
string appears in the status bar (if there is one). You can activate
"fly by" status bar updating to display the status string when the
mouse is positioned over the button without pressing it.
CProgressCtrl
Possible Uses
Tab Object
Remarks
For each Tab object, you can use various properties to specify its
appearance, and you can specify its state with the Selected
property.
At design time, use the Insert Tab and Remove Tab buttons on the
Tabs tab in the Properties Page of the TabStrip control to insert and
remove tabs, and use the text boxes to specify any of these
properties for a Tab object: Caption, Image, ToolTipText, Tag,
Index, and/or Key. You can also specify these properties at run
time.
Each Tab object also has read-only properties you can use to
reference a single Tab object in the Tabs collection: Left, Top,
Height and Width.
DataGrid Control
Remarks
Each cell of a DataGrid control can hold text values, but not linked
or embedded objects. You can specify the current cell in code, or
the user can change it at run time using the mouse or the arrow
keys. Cells can be edited interactively, by typing into the cell, or
programmatically. Cells can be selected individually or by row.
If a cell's text is too long to be displayed in the cell, the text wraps
to the next line within the same cell. To display the wrapped text,
you must increase the cell's Column object's Width property and/or
the DataGrid control's RowHeight property. At design time, you can
change the column width interactively by resizing the column or by
changing the column's width in the Column object's property page.
When you select a cell, the ColIndex property is set, thus selecting
one of the Column objects in the DataGrid object's Columns
collection. The Text and Value properties of the Column object
reference the contents of the current cell. The data in the current
row can be accessed using the Bookmark property, which provides
access to the underlying Recordset object's record. Each column of
the DataGrid control has its own font, border, word wrap, and other
attributes that can be set without regard to other columns. At
design time, you can set the column width and row height and
establish columns that are not visible to the user. You can also
prevent users from changing the formatting at run time.
Note If you use the Move method to position the DataGrid control,
you may need to use the Refresh method to force it to repaint.
Columns
Name Type Size
---------------------------------------------------------------------
Book Name Text 60
Edition Text 10
Pages Text 10
Author Text 60
Publisher Text 50
Department Text 30
Subject Text 20
ISBN Text 20
Price Currency -
Access No (Primary Key) Long Integer -
Place Text 200
Table: issuebook
Columns
Name Type Size
----------------------------------------------------------------------
Book Name Text 60
Edition Text 10
Author Text 60
Department Text 30
Subject Text 20
ISBN Text 20
Access No (Primary Key) LongInteger -
Price Currency -
Issue Date Date/Time -
Return Date Date/Time -
Reg No. Text 10
Table: Avaibook
This table stores the information about all the available books.
If book is issued or returned to or from staff or student then
according changes are made to the table. Access No. is defined as a
primary key.
Columns
Name Type Size
---------------------------------------------------------------------
Book Name Text 60
Edition Text 10
Author Text 60
Department Text 30
Subject Text 20
ISBN Text 20
Price Currency -
Access No (Primary Key) LongInteger -
Table: login
MODULE
Option Explicit
Public con As ADODB.Connection
Public rs As ADODB.Recordset
Public rsfine As ADODB.Recordset
Public rsday As ADODB.Recordset
Public rsavai As ADODB.Recordset
Public rsissue As ADODB.Recordset
Public rstotal As ADODB.Recordset
Public sql As String
Public sqlfine As String
Public sqlday As String
Public sqlavai As String
Public sqlissue As String
Public sqltotal As String
Public onamemgmt As String
Public opassmgmt As String
Public onamestu As String
Public opassstu As String
Public imgX As ListImage
Public btnX As Button
con.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=I:\tejas\04CE125\4th_sem\vb\project\libsys.mdb;Per
sist Security Info=False")
rs.Open "select * from login", con, 3, 3
sql = "select * from login"
Set rs = con.Execute(sql)
rsfine.Open "select * from multiplier", con, 3, 3
sqlfine = "select * from multiplier"
Set rsfine = con.Execute(sqlfine)
rsday.Open "select * from returndays", con, 3, 3
sqlday = "select * from returndays"
Set rsday = con.Execute(sqlday)
rsavai.Open "select * from avaibook", con, 3, 3
sqlavai = "select * from avaibook"
Set rsavai = con.Execute(sqlavai)
rsissue.Open "select * from issuebook", con, 3, 3
sqlissue = "select * from issuebook"
Set rsissue = con.Execute(sqlissue)
rstotal.Open "select * from totalbooks", con, 3, 3
sqltotal = "select * from totalbooks"
Set rstotal = con.Execute(sqltotal)
End Sub
Public Sub datalinkclose()
rs.Close
rsfine.Close
rsavai.Close
rstotal.Close
con.Close
End Sub
Public Sub loadtbs()
MDIlibsys.Toolbar2.ImageList = MDIlibsys.ImageList2
End Sub
MDIlibsys.Toolbar1.ImageList = MDIlibsys.ImageList1
End Sub
START UP
frmaboutus.Show
End Sub
Private Sub avaibooks_Click()
frmavaibook.Show
frmavaibook.SetFocus
End Sub
Private Sub book_Click()
frmsearchbook.Show
frmsearchbook.SetFocus
End Sub
Private Sub chnguidpass_Click()
frmchnguidpass.Show
frmchnguidpass.SetFocus
End Sub
frmedit.Show
frmedit.SetFocus
frmedit.fmmulti.Visible = False
frmedit.fmdays.Visible = True
frmedit.txtndaysvalue.SetFocus
End Sub
Private Sub editfine_Click()
frmedit.Show
frmedit.SetFocus
frmedit.fmdays.Visible = False
frmedit.fmmulti.Visible = True
frmedit.txtnmultivalue.SetFocus
End Sub
Private Sub editlibbook_Click()
frmadddeleteb.Show
frmadddeleteb.SetFocus
Unload frmtotalbook
End Sub
Private Sub editrulesreg_Click()
frmeditrules.Show
frmeditrules.SetFocus
Unload frmshowrules
End Sub
Private Sub exit_Click()
Module1.datalinkclose
Unload Me
End Sub
End Sub
Private Sub helptotic_Click()
frmhelp.Show
End Sub
Private Sub issue_Click()
frmissuereturn.Show
frmissuereturn.tbissuereturn.Tab = 0
frmissuereturn.txtisaccess.SetFocus
Unload frmavaibook
Unload frmissuebook
End Sub
Private Sub issuebooks_Click()
frmissuebook.Show
frmissuebook.SetFocus
End Sub
Private Sub libbooks_Click()
frmtotalbook.Show
frmtotalbook.SetFocus
End Sub
Private Sub login_Click()
frmadddeleteb.Hide
frmavaibook.Hide
frmbookretoday.Hide
frmchnguidpass.Hide
frmedit.Hide
frmeditrules.Hide
frmfinebook.Hide
frmissuebook.Hide
frmissuereturn.Hide
frmlibsysadmin.Hide
frmlibsysstu.Hide
frmlogin.Hide
frmsearchbook.Hide
frmshowrules.Hide
frmtotalbook.Hide
admin.Enabled = False
view.Enabled = False
chnguidpass.Enabled = False
edit.Enabled = False
search.Enabled = False
help.Enabled = False
Toolbar1.Visible = False
Toolbar2.Visible = False
frmlogin.Show
End If
End Sub
Module1.datalinkopen
admin.Enabled = False
view.Enabled = False
chnguidpass.Enabled = False
edit.Enabled = False
search.Enabled = False
help.Enabled = False
pb1.Value = 0
log = False
Toolbar1.Visible = False
Toolbar2.Visible = False
End Sub
Private Sub return_Click()
frmissuereturn.Show
frmissuereturn.tbissuereturn.Tab = 1
frmissuereturn.txtreaccess.SetFocus
Unload frmavaibook
Unload frmbookretoday
Unload frmfinebook
Unload frmissuebook
End Sub
Private Sub returntdbooks_Click()
frmbookretoday.Show
frmbookretoday.SetFocus
End Sub
Private Sub rulesreg_Click()
frmshowrules.Show
frmshowrules.SetFocus
End Sub
Private Sub timer_Timer()
pb1.Value = pb1.Value + 1
If pb1.Value = 100 Then
timer.Enabled = False
pb1.Visible = False
piclibsys.Visible = False
picimage.Visible = False
frmlogin.Show
End If
End Sub
End Sub
Private Sub Toolbar2_ButtonClick(ByVal Button As
MSComctlLib.Button)
End Sub
LOGIN
Dim ok As Integer
Unload Me
End Sub
Private Sub cmdlogok_Click()
fmlogged.Visible = False
If ok = 0 Then
fmlogin.Visible = True
ElseIf txtpass.Text = opassmgmt Then
frmlibsysadmin.Show
MDIlibsys.admin.Enabled = True
MDIlibsys.chnguidpass.Enabled = True
MDIlibsys.view.Enabled = True
MDIlibsys.edit.Enabled = True
MDIlibsys.search.Enabled = True
MDIlibsys.help.Enabled = True
MDIlibsys.Toolbar1.Visible = True
Module1.loadtba
Unload Me
ElseIf txtpass.Text = opassstu Then
frmlibsysstu.Show
MDIlibsys.view.Enabled = True
MDIlibsys.search.Enabled = True
MDIlibsys.help.Enabled = True
MDIlibsys.Toolbar2.Visible = True
Module1.loadtbs
Unload Me
End If
End Sub
Private Sub cmdok_Click()
fmlogin.Visible = False
fmlogged.Visible = True
If (txtname.Text = onamemgmt And txtpass.Text =
opassmgmt) Or (txtname.Text = onamestu And txtpass.Text
= opassstu) Then
lbllog.Caption = "You have logged successfully..."
ok = 1
MDIlibsys.login.Caption = "Logout"
MDIlibsys.log = True
Else
lbllog.Caption = "login failed..." & vbNewLine & "user name
or password incorrect"
ok = 0
End If
End Sub
Private Sub Form_Load()
fmlogged.Visible = False
lbldate.Caption = Format(Date, "dddd, d mmmm, yyyy")
onamemgmt = rs.Fields("namemgmt").Value
opassmgmt = rs.Fields("passmgmt").Value
onamestu = rs.Fields("namestu").Value
opassstu = rs.Fields("passstu").Value
End Sub
CHANGE UID & PASSWORD
Dim ok As Integer
Dim nname As String
Dim npass As String
Unload Me
End Sub
Private Sub cmdchngok_Click()
If ok = 0 Or ok = 4 Then
fmchngok.Visible = False
fmchng.Visible = True
ElseIf ok = 1 Or ok = 2 Then
Unload Me
End If
End Sub
Private Sub Form_Load()
ok = 0
nname = ""
npass = ""
onamemgmt = rs.Fields("namemgmt").Value
opassmgmt = rs.Fields("passmgmt").Value
onamestu = rs.Fields("namestu").Value
opassstu = rs.Fields("passstu").Value
End Sub
EDIT RETURN DAYS
Unload Me
End Sub
Private Sub cmddaysok_Click()
fmdays.Visible = False
fmok.Visible = True
nday = Val(txtndaysvalue.Text)
sqlday = "update returndays set days = " & nday & " where
days = " & oday & " "
con.Execute (sqlday)
End Sub
Private Sub cmdmultiok_Click()
fmdays.Visible = False
fmok.Visible = True
nfine = Val(txtnmultivalue.Text)
sqlfine = "update multiplier set fine = " & nfine & " where fine
= " & ofine & " "
con.Execute (sqlfine)
End Sub
Private Sub cmdok_Click()
Unload Me
End Sub
Private Sub Form_Load()
ofine = rsfine.Fields("fine").Value
lblomultivalue.Caption = ofine
oday = rsday.Fields("days").Value
lblodaysvalue.Caption = oday
End Sub
EDIT LIBRARY BOOKS
Private Sub cmdadd_Click()
If chkavaibook.Value = 1 Then
sqlavai = "insert into avaibook values ('" & txtbookname &
"','" & txtedition & "','" & txtauthor & "','" & txtdept & "','" &
txtsub & "','" & txtisbn & "','" & txtprice & "'," & txtaccessno &
")"
con.Execute (sqlavai)
End If
txtbookname.Text = ""
txtedition.Text = ""
txtpages.Text = ""
txtauthor.Text = ""
txtpublisher.Text = ""
txtdept.Text = ""
txtsub.Text = ""
txtisbn.Text = ""
txtprice.Text = ""
txtaccessno.Text = ""
txtplace.Text = ""
End Sub
Private Sub cmddelete_Click()
rsavai.MoveNext
Else
rsavai.MoveNext
End If
Loop
rsavai.MoveFirst
txtaccessnod.Text = ""
txtisbnd.Text = ""
txtbooknamed.Text = ""
txteditiond.Text = ""
txtauthord.Text = ""
txtdeptd.Text = ""
txtsubd.Text = ""
txtpriced.Text = ""
txtpagesd.Text = ""
txtpublisherd.Text = ""
End Sub
Private Sub txtaccessnod_LostFocus()
Dim ano As Integer
rstotal.MoveNext
Else
rstotal.MoveNext
End If
Loop
rstotal.MoveFirst
End Sub
AVAILABLE BOOKS
ISSUED BOOKS
Unload Me
End Sub
Private Sub cmdissue_Click()
txtisaccess.Text = ""
txtisisbn.Text = ""
txtisname.Text = ""
txtisedition.Text = ""
txtisauthor.Text = ""
txtisdept.Text = ""
txtissub.Text = ""
txtisprice.Text = ""
txtisdate.Text = ""
txtisreturndate.Text = ""
txtisregno.Text = ""
End If
End Sub
Private Sub cmdrereturn_Click()
txtreaccess.Text = ""
txtreisbn.Text = ""
txtrename.Text = ""
txtreedition.Text = ""
txtreauthor.Text = ""
txtredept.Text = ""
txtresub.Text = ""
txtreprice.Text = ""
txtreissuedate.Text = ""
txtrereturndate.Text = ""
txtreregno.Text = ""
txtfine.Text = ""
End If
End Sub
Private Sub txtisaccess_LostFocus()
Dim ano As Integer
Dim dtf As Boolean
dtf = False
Do While rsavai.EOF = False
ano = rsavai.Fields("accessno").Value
rsavai.MoveNext
Else
rsavai.MoveNext
End If
dtf = True
Loop
If dtf = True Then
rsavai.MoveFirst
End If
End Sub
Private Sub txtreaccess_LostFocus()
Dim ano As Integer
Dim fine As Integer
Dim dtf As Boolean
dtf = False
fine = 0
Do While rsissue.EOF = False
ano = rsissue.Fields("accessno").Value
rsissue.MoveNext
Else
rsissue.MoveNext
End If
dtf = True
Loop
If dtf = True Then
rsissue.MoveFirst
End If
End Sub
SEARCH BOOK
Dim r As Long
Dim c As Long
Private Sub cmdgo_Click()
t1.Enabled = True
pb.Value = 0
pb.Visible = True
lblsearch(1).Visible = True
End Sub
Private Sub Form_Load()
pb.Value = 0
t1.Enabled = False
r=1
End Sub
Private Sub t1_Timer()
pb.Value = pb.Value + 2
If pb.Value = 100 Then
pb.Visible = False
lblsearch(1).Visible = False
t1.Enabled = False
fgsearch.Visible = True
fgsearch.ColWidth(1) = 3700
fgsearch.ColWidth(2) = 2000
fgsearch.ColWidth(3) = 2550
fgsearch.ColWidth(4) = 2000
fgsearch.ColWidth(5) = 4000
fgsearch.TextMatrix(r, 0) = r
c=1
fgsearch.TextMatrix(r, c) = rsavai.Fields("Book
Name").Value
c=c+1
fgsearch.TextMatrix(r, c) =
rsavai.Fields("Edition").Value
c=c+1
fgsearch.TextMatrix(r, c) =
rsavai.Fields("Author").Value
c=c+1
fgsearch.TextMatrix(r, c) =
rsavai.Fields("AccessNo").Value
c=c+1
fgsearch.TextMatrix(r, c) =
rstotal.Fields("Place").Value
r=r+1
fgsearch.Rows = fgsearch.Rows + 1
rsavai.MoveNext
Else
rsavai.MoveNext
End If
Loop
End If
rsavai.MoveFirst
End Sub
End Sub
Private Sub cmddeleterule_Click()
Dim str As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
k = listrules.ListCount - 1
For i = 0 To k
If listrules.Selected(i) Then
str = listrules.List(i)
listrules.RemoveItem (i)
sqlrule = "delete from rulesreg where RULE = '" & str &
"' "
con.Execute (sqlrule)
i = -1
k=k-1
End If
If k = i Then
Exit Sub
End If
Next
End Sub
Private Sub Form_Load()
Set rsrule = New ADODB.Recordset
End Sub
HELP
ABOUT LIBRARY SYSTEM
SUPPORTS
• Mastering Visual Basic 6.0
• Visual Basic Programming Black Book
• MSDN Library
• Microsoft Windows Access 2003 Help