rajeev ranjan project mca 3rd sem
DESCRIPTION
vb project on seating arrangementTRANSCRIPT
Seating Arrangement
Submitted in partial fulfillment of the requirements for the awards of the degree of
Master of computer application
[Software Engineering]
Guide: Submitted by: Mrs. Jyostna Rajeev Ranjan
MCA (SE)- IIIrd Sem.
Rollno: 0171644508
University School of Information TechnologyGGS Indraprastha University, Delhi-110006
(2008-2011)
1
CERTIFICATE
This is to certify that the project report (IT-755) entitled “Seating Arrangement”
done by Mr. Rajeev Ranjan , Roll no. 0171644508 is an authentic work carried out
by him under my guidance. The matter embodied in this project work has not been
submitted earlier for the award of any degree or diploma to the best of my
knowledge and belief.
Date: Mrs. Jyotsna
USIT,GGSIPU
2
Acknowledgement
I would like to thank my project guide, Mrs. Jyotsna for her guidance. This project
entitled “Seating Arrangement” could not have been completed without the
flexibility and support provided by her to me to pursue this project.
I wish to thank our project in charge Mr. Sanjay Malik for coordinating all
the project related activities.
At last I wish to express my sincere thanks to all the authors whose works
(both online and in print) we have referred to, in course of my study of the subject.
3
Rajeev RanjanMCA (SE)-IIIrd Sem.0171644508USIT, [email protected]
Table of contentsContents pageno1.
1.1Introduction 6
1.1.1 Purpose 6
1.1.2 Scope 6
1.1.3 Definitions, Acronyms, and Abbreviations 6
1.2. Overall Description 6
1.2.1 Product Perspective 8
1.2.1.1 System Interfaces 8
1.2.1.2 User Interfaces 8
1.2.1.3 Hardware Interfaces 8
1.2.1.4 Software Interfaces 9
1.2.1.5 Memory Constraints 9
1.2.2 Product Functions 9
1.2.3 Constraints 10
1.2.4 Assumptions and Dependencies 10
4
1.3. Specific Requirements 10
1.3.1 External Interface Requirements 10
1.3.2 Functional Requirements 11
1.3.2.1 Validity checks on the inputs 11
1.3.2.2 Exact sequence of operations 11
1.3.2.3 Responses to abnormal situation 12
1.3.3 Performance requirement 12
1.3.4 Logical Database requirements 12
1.3.5 Software System attributes 12
1.3.5.1 Reliability 12
1.3.5.2 Availability 12
1.3.5.3 Security 12
1.3.5.4 Maintainability 13
2. Data flow diagram 13
3. Entity Relationship Diagram 14
4. Data dictionary: 14
4.1. Description of modules 15
4.2Student information and maintenance module: 15
4.3Course information module: 15
4.4Subject information module: 15
4.5Database maintenance module: 16
5. Uses Case Diagram: 16
5.1Uses Case description: 17
5.2. Maintain student information 18
5
5.3Maintain Subject Information 20
5.4. Maintain User Accounts 24
6. Coding 28
7. Snapshots 45
8. References: 53
1. Software Requirements Specification (S.R.S)
1. Introduction:
1.1.1 Purpose
The purpose of this documentation is to present the Software Requirement
Specification for Seating Arrangement for the Examination department .This
Document illustrate the how this software makes easier of arranging seat for an
Examination.
1.1.2 Scope
The software product “Seating Arrangement “is a application which arranges the
Seat matrix for an examination. The application creates the databases for different
Allocation table at run time, information provided by user. The application then
establishes the connection to access database and allocates the seat for students.
1.1.3 Definitions:
DSN: Stands for data source name
It specifies the source name from where the data is coming.
Connection string:
Connections string has information required to connect to a database. It generally consist of information of provider, drivers, data source, user name, password etc.
6
Record set:
Recordset object is used for the management of records that result from database request.
1.2. Overall Description:
A data base is an ordered set of data that is usually saved in one or several files
that belong together. The data is structured as tables, with reference from one
table to another being possible.
There are various type of database management system are available for use like
DB2, oracle, MS-Access. All of them have their own advantages and
disadvantages.
MS-Access is treated comparatively simple than other database system in terms
of learning and using but not suitable for large databases.
Some time the user need to create the database at runtime as per user
requirement for taking advantage of that database system.
The application “seating Arrangement” design and arranges seat matrix in
MS Access format. This application is general purpose that is it takes the
information about database to create of any size and can be added any number of
tables to MS Access database. The application takes database name as the input.
User must have proper right to use the application. Then it establishes the
connection to MS Access database. After successful establishing of connection
the application takes the name of table, number of column, number of rows as
input from the user and creates the table in runtime in the specified database
name provided earlier by the user. Then application establishes the connection to
7
the table and adds records as per our requirement specified or defined for the
application.
1.2.1Product Perspective:
This application is fully windows based self contained and independent software
Product products.
1.2.1.1 System Interface:
None
1.2.1.2 User Interface:
This system has very user friendly and menu based interface. Following screens
will be provided:
1 .A login screen for entering the username , password and user name. Access to
different screens will be based on the information provided.
2. There is the screen for creating the databases and opening databases.
3. There is a form in which user can specify the table name and size of the table.
8
FRONT END APPLICATION
IN VB 6.0
MS ACCESS
DATABASE
1.2.1.3 Hardware Interface:
The hardware interfaces for this application are:
I. Screen resolution of at least 800 x 600 for proper and complete viewing
of screens. But performs best at 1024 x 768.
ii. Proper hardware configuration for running oracle and MS-Access databases
1.2.1.4 Software Interface:
The software interfaces for this application are:
i. Windows Xp/ windows 98
ii. MS Access 2003 or any higher version of MS Access as the DBMS for
database.
iii. Visual Basic 6- for coding /developing the software.
iv. Oracle database
1.2.1.5 Communication interfaces
None
1.2.1.5 Memory Constrains:
At least 128 MB ram and 1 GB hard disk space will be required.
1.2.2 Product Functions:
The system will allow access only to authorized users. Those can access the
Access database can establish the connection by providing the information.
Following are the major functions that will be provided by the system:
i. Login facility for enabling only authorized access to system.
ii. Authorized user specifies the database information require creating or opening
9
the databases.
iii. The application establishes the connection on the run time.
iv. The application provides the functionality to input the name of table to be
created or opened.
v. Then it accesses the records of the table to be evaluated according to
application.
vi. using the above information it generate the report table into MS-Access
format.
1.2.3 Constraints:
i. Due to limited features of DBMS being used performance tuning features
will not be applied to the queries and thus the system may become slow
with the increase in number of records.
ii. Due to the limited features of the DBMS database Auditing will also not
be provided.
iii. Administrator will have to implement a security policy to safeguard the
Records from unauthorized users.
1.2.4 Assumptions and Dependencies:
i. A user must have the knowledge of using application the handle databases.
ii. The user must know username and password to access database
1.3. Specific Requirements:
This section contains the software requirements to a level of detail sufficient to
enable designers to design the system, and testers to test that system.
1.3.1 External Interface Requirements:
10
1.3.1.1 User Interfaces:
The following screens will be provided to the users:
1. Login Screen: from this screen the user will login to the application. Various
fields available for this screen will be
(a) User ID: alphanumeric of length up to 10 characters
(b) Password: alphanumeric of length up to 8 characters
2. Step1 Screen: After logging in successfully by the user the step1 screen of
the application will appear. The user can enter the database information for
MS Access database.
3. step2 screen: Next screen is step2 screen in witch user can input the table
name and size of the table to be created.
4. Step3 screen: in this screen user can specify the course information of the
student for allocation of seat matrix. Also can specify multiple course
information.
1.3.1.2 Hardware interfaces
As stated in section 2.1.3
1.3.1.3 Software interfaces
As stated in section 2.1.4
1.3.2 System feature
1.3.2.1 Validity checks on the inputs:
(i) Only the authorized user can access the database and application.
(ii) Proper validity checks should be imposed while data is being transfer from
one database to other.
11
1.3.2.2 Exact sequence of operations
There must exist an Ms Access database to be opened. The user must have
proper right to access the Ms Access database before using this application the
connection must be established and tested before the transaction between
different tables takes place. A User can exit from the application whenever
he/she wants.
1.3.2.3 Responses to abnormal situation
Error handling and recovery
Erroneous data operations are rejected with an error message prompt. No
recovery module is needed as erroneous operation is not allowed to
proceed.
1.3.3 Performance requirement
None
1.3.4 Design Constraints
None
1.3.5 Logical Database requirements:
(i) Log: user id, password
(ii) Student info: enroll no., student name, course_id, year
1.3.6 Software System attributes:
1.3.6.1 Reliability
The system would be reliable enough to save a number of records.
1.3.6.2 Availability
The system has to run as per the requirement of the user.
12
1.3.6.3 Security
The system will use password protection to allow only authentic users to access
The system according to their privilege.
1.3.6.4 Maintainability
The application is to be designed in a maintainable manner. It should be easy to
Incorporate new requirements in the individual modules.
2. Data flow diagram
Student details
Data entry operator
13login
Student info management
Reportgeneration
Id, password
User account info
Administrator
Entity Relationship Diagram:
14
Useraccount
management
student course
subject
Consist of
Study in
Student id
Student name
age
Course nameCourse id
Subject id Subject name
Data dictionary:Data dictionary describes the columns, which are used in the development of
the system. It is one of the most important DBA tools. The data dictionary describes effectively a database that contains information about the entities.
Database profile helps connecting to the database; it prevents unauthorized use of database. Following are the tables and views that the database contains. TABLE NAME: Student record
NAME TYPE WIDTHStrudent_id Number 10Student name Text 20Course_id Number 06Year_of_adm Date --
TABLE NAME: Course RecordNAME TYPE WIDTHCourse_id Number 05Course name Text 20No_of_Sem Number 06
TABLE NAME: Subject RecordNAME TYPE WIDTHCourse_id Number 05Subject_id Text 20Subject name Text 06
DESCRIPTION OF MODULES System is controlled in market units of limited size to simplify development
and maintenance when necessary, modification of S/W is done partly due to separate
function they perform. Our system can be modularized into various modules each
one performing some specific function to achieve their objective. There modules
are:
Student information and maintenance module:
This module consists of functions that perform the operation to keep record of
individual information of students in data file. All The details of a single student act
as a single record in the file.
15
Course information module:
This module consists of functions that perform the operation to keep record of
course related information like subject id, course id , subject name ,no of semester in
which they taught etc. All these information are used to maintain the relation
between student in college and their respective course.
Subject information module: This module consists of functions that perform the operation to keep record of subject name in each semester of course and all optional subjects also. It also keeping the record of new subjects if it is going to be add in particular course.The various operations can be performed on the data files:
1. Addition of new records.
2. Deletion of a particular record
3. Retrieving data.
4. Displaying data.
5. Modification of any information stores.
Database maintenance module: This module is used to maintain the entire database which are created for each examination time and keeping all the seating arrangement record with room no. So, that if any requirement occurs then can able to open and see their information
3. Uses Case Diagram:
Maintain Student info. Add/modify/delete student details
Login
16
DataEntry operator
Reset System Maintain Subject info. Deletion of all existing Add/Modify/delete subject Information from the for different semester
from backend database
Maintain user Accounts Generate Reports Add modify/delete user 1.student list report
Accounts 2.seating arrangement report
Uses Case description:
1. Login
1.1. Brief Description
This use case describes how a user logs into the Seating Arrangement System
1.2.Actors
The following actor(s) interact and participate in this use case:
Data Entry operator, Administrator, Co-coordinator.
1.3.Flow of controls
This use case starts when the actor wishes to login to the Seating Arrangement
system.
17
administrator
Co-ordinator
1. The system requests that the actor enter his/her name, password and role.
The role can be any one of data entry operator, co-ordinator or
administrator.
2. The actor enters his/her name, password and role.
3. The systems validate the entered name, password, and role and log the
actor into the system.
1.3.2. Alternative flows
1.3.2.1Invalid name/password/role
If in the basic flow, the actor enters an invalid name, password and /or role, the system
displays an error message. The actor can choose to either return to the beginning of
the basic flow or cancel the login, at which point the use case ends.
1.4 Special Requirements
None
1.5 Pre-Conditions
All users must have a user account created for them in the system, prior to
executing the use cases. If the use case was successful, the actor is logged into the
system. If no, the system state is unchanged. If the actor has the role ‘Data entry
operator’ he /she will have access to only screen corresponding to the subject info
maintenance, student info maintenance module of the system.
If the actor has the role ‘administrator’ he/she/ will have access to only screen
corresponding to user account maintenance module and reset system feature of the
system.
18
1.7 Extension points
None
2. Maintain student information
2.1 Brief Description
This use case allows the actor with role ‘Data Entry operator’ to maintain student
information. This includes adding, changing and deleting student information from the
system.
2.2 Actors
Data Entry Operator
2.3 Flow of Events
2.3.1 Basic Flow
This use case starts when the data entry operator wishes to add, change, and/ or
delete student information from the system.
1. The system requests that the data entry operator specify the function he/ she
would like to perform.
2. Once the data entry operator provides the requested information, one of the sub-
flows is executed.
a. If the data entry operator selected “Add a Student”, the Add a student Sub-
flow is executed.
b. If the data Entry operator selected” Update a student”, the update a student
sub flow is executed.
c. If the data entry operator selected “Delete a student” , the delete a student
sub flow is executed
19
2.3.1Alternative flows
2.3.1.1 Student not found
If in the update a student or delete a student sub-flows, a student with the specified
enrollment number does not exist, and the system displays an error message. The data
entry operator can then enter a different enrollment number or cancel the operation, at
which points the use case ends
2.3.1.2 Update cancelled
If in the update a student sub-flow, the data entry operator decides not to update the
student information, the update is cancelled and the basic flow is re-started at the
beginning.
2.3.1.3 delete cancelled
If in the delete a student sub-flow, the data entry operator decides not to delete the
student information, the delete is cancelled and the Basic Flow is re-started at the
beginning.
2.3 Special Requirements
None
2.4 pre-condions
The data entry operator must be logged onto the system before these use case
beginnings.
2.5 Post-Condition
If the use case was successful, the student information is added, updated, or deleted
from the system otherwise, the system state is unchanged
20
2.6 Extension points
None
3. Maintain Subject Information
3.1 Brief Description
This use case allows the actor with role ‘Data Entry Operator’ to maintain subject
information. This includes adding, changing and deleting subject information from the
system.
Actor
Data Entry Operator.
Flow of Event
3.3.1 Basic Flow
The use case starts when DEO wishes to add, change, and/or delete subject
information from the system.
(i) The system requests DEO to specify the function he/she would like to perform.
• Add a subject
• Update a subject
• Delete a subject.
(ii) Once the DEO provides the required information, one of the sub flows is executed.
A. If DEO selected “Add a subject” the “Add-a subject sub flow is executed.
b. If DEO selected “Update-a subject” the “update-a- subject” sub flow is executed
c. If DEO selected “Delete- a- subject”, the “Delete-a-subject “sub flow is executed.
3.5.1 Add a Subject
21
(i) The System requests the DEO to enter the subject information. This includes:
* Name of the subject
3.5.2 Update a Subject
(i) The system requests the DEO to enter subject_id.
(ii) DEO enters the subject_id. The system retrieves and displays the subject
information.
(iii) DEO makes the changes.
(iv) Record is updated
3.5.3 Delete a Subject
(i) Entry of subject_id.
(ii) After this, system retrieves & displays subject information.
* System prompts the DEO to confirm the deletion.
* DEO verifies the deletion.
* The system marks the subject record for deletion.
3.6 Alternative Flow
3.6.1 Subject not found
If in any sub flows, subject-id not found, error message is displayed. The DEO may
enter a different id or cancel the case ends here.
3.6.2 Update Cancelled
If in the update a subject sub-flow, the data entry operator decides not to update the
22
subject information, the update is cancelled and the basic flow is restarted at the
begin.
3.6.3 Delete Cancellation
If in delete-a-subject sub flow, the DEO decides not to delete subject, the delete is
cancelled, and the basic flow is restarted from the beginning.
3.7 Special Requirements:
None
3.8 Use Case-relationships
None
4. Generate Report
4.1 Introduction
This use case allows the DR to generate Student reports. Options are
a. Course code wise
b. Semester wise
C. Enrollment Number wise
4.2 Actors
Data Reporter
4.3 Pre-Conditions
DR must logged on to the system
23
4.4 Post conditions
If use case is successful, desired report is generated. Otherwise, the system state is
unchanged.
4.5 Basic Flow
The use case starts, when DR wishes to generate reports.
(i) DR selects option.
(ii) System retrieves the information displays.
(iii) DR takes printed reports.
4.6 Alternative Flows
4.6.1 Record not found
If not found, system generates appropriate message. The DR can select another
option or cancel the operation. At this point, the use case ends.
4.7 Special Requirements
None
4.8 Use case relationships
None
5. Maintain User Accounts
5.1 Introduction
This use case allows the administrator to maintain user account. This includes
adding, changing and deleting user account information from the system.
24
5.2 Actors
Administrator
5.3 Pre-Conditions
The administrator must be logged on to the system before the use case begins.
5.4 Post-Conditions
If the use case was successful, the user account information is added, updated, or
deleted from the system. Otherwise, the system state is unchanged.
5.5 Basic Flow
This use case starts when the Administrator wishes to add, change, and/or delete use
account information from the system.
(i) The system requests that the Administrator specify the function he/she would like
to perform (add a User Account, Update a User Account, or Delete a User
Account).
(ii) Once the Administrator provides the requested information, one of the sub-flows
is executed
* If the Administrator selected “Add a User Account”, the Add a User Account sub
flow is executed.
* If the Administrator selected “Update a User Account”, the Update a User
Account sub-flow is executed.
* If the Administrator selected “Delete a User Account”, the Delete a User Account
25
sub-flow is executed.22
5.5.1 Add a User Account
1. The system requests that the Administrator enters the user information. This
includes:
(a) User Name
(b) User ID-should be unique for each user account
(c) Password
(d) Role
2. Once the Administrator provides the requested information, the user account
information is added.
5.5.2 Update a User Account
1. The system requests that the Administrator enters the User ID.
2. The Administrator enters the User ID. The system retrieves and displays the user
account information.
3. The Administrator makes the desired changes to the user account information.
This includes any of the information specified in the Add a User Account sub-flow.
4. Once the Administrator updates the necessary information, the system updates the
user account record with the updated information.
5.5.3 Delete a User Account
1. The system requests that the Administrator enters the User ID.
26
2. The Administrator enters the User ID. The system retrieves and displays the user
account information.
3. The system prompts the Administrator to confirm the deletion of the user account.
4. The Administrator confirms the deletion.
5. The system deletes the user account record.
5.6 Alternative Flows
5.6.1 User Not Found
If in the Update a User Account or Delete a User Account sub-flows, a user
account with the specified User ID does not exist, the system displays an error
Message. The Administrator can then enter a different User ID or cancel the
operation, at which point the use case ends.
5.6.2 Update Cancelled
If in the Update a User Account sub-flow, the Administrator decides not to update
the user account information, the update is cancelled and the Basic Flow is re-
started at the beginning.
5.6.3 Delete Cancelled
If in the Delete a User Account sub-flow, the Administrator decides not to delete
the user account information, the delete is cancelled and the Basic Flow is re-started
at the beginning.
5.7 Special Requirements
27
None
5.8 Use case relationships
None
4. Coding
Splash form:
Option Explicit
Private Sub Form_KeyPress (KeyAscii as Integer)
Unload Me
End Sub
----------------------------------------------------------------------------------------------------
Private Sub Form Load ()
ProgressBar1.Value = 0
Timer1.Enabled = True
End Sub
---------------------------------------------------------------------------------------------------
Private Sub Timer1_Timer ()
ProgressBar1.Value = ProgressBar1.Value + 25
If ProgressBar1.Value >= 100 Then
Timer1.Enabled = False
frmlogin.Show
Me. Hide
End If
28
End Sub
-------------------------------------------------------------------------------------------------
MDI Form:
Private Sub MDIForm_Load ()
mnuEdit.Visible = False
End Sub
Private Sub mnuExit_Click ()
End
End Sub
--------------------------------------------------------------------------------------------------------
Private Sub mnuFileOpenDesign_Click ()
End Sub
Private Sub mnuFileCreate_Click ()
Form1.Show
End Sub
--------------------------------------------------------------------------------------------------------
Private Sub mnuFileOpen_Click ()
db1 = Input Box ("Enter the database name")
Yr = Input Box ("Enter the year")
db1 = db1 & yr
'tb = db1 & yr
'db1 = db1 & ".mdb"
Unload Me
29
Load Form4
Form4.Show
'Load Form4
'Form4.Show
'Load studentfrm
'studentfrm.Show
'Load Form2
'Form2.Show
End Sub
-------------------------------------------------------------------------------------------------------
Login Form:
Dim db As Database
Dim rs As Recordset
Private Sub cmdcancel_Click ()
txtuserpassword.Text = ""
txtuserpassword.SetFocus
cmdcancel.Enabled = False
End Sub
--------------------------------------------------------------------------------------------------------
Private Sub Form_Activate ()
txtusername.SetFocus
End Sub
-------------------------------------------------------------------------------------------------------
Private Sub cmdhelp_Click ()
30
MsgBox "For proceeding to the next window please enter the valid username and
password. After that press OK.” vbInformation, "HELP BUTTONS"
End Sub
--------------------------------------------------------------------------------------------------------
Private Sub cmdok_Click ()
On Error GoTo ex
If rs.RecordCount = 0 Then
Exit Sub
End If
rs.MoveFirst
While not rs.EOF
If rs.Fields(0) = txtusername.Text And _
rs.Fields(1) = txtuserpassword.Text Then
MsgBox "Valid User", vbInformation
Unload Me
mainfrm.Show
Exit Sub
End If
rs.MoveNext
Wend
MsgBox "Invalid User..", vbCritical
'cmdok.Enabled = False
'cmdcancel.Enabled = False
'txtuserpassword.Locked = True
31
txtusername.Text = ""
txtuserpassword.Text = ""
txtusername.SetFocus
ex:
MsgBox "Database already exist"
End Sub
---------------------------------------------------------------------------------------------------
Private Sub Form_Load()
Set db = OpenDatabase(App.Path + "\log.mdb")
Set rs = db.OpenRecordset("login")
End Sub
------------------------------------------------------------------------------------------------------
Private Sub Timer1_Timer()
Label4.Caption = Time
Label5.Caption = Date
End Sub
--------------------------------------------------------------------------------------------------------
Create Database:
Dim db As Database
Dim wrk As Workspace
Dim tabldf As TableDef
Dim fld As Field
'Dim tablename As String
32
'Dim dbname As String
Dim year As String
Dim a As String
Dim rs As Recordset
-------------------------------------------------------------------------------------------------------
Private Sub cmdcancel_Click()
dbnametxt.Text = " "
dbnametxt.SetFocus
yeartxt.Text = Clear
tablenametxt.Text = Clear
End Sub
--------------------------------------------------------------------------------------------------------
Private Sub cmdexit_Click()
End
End Sub
--------------------------------------------------------------------------------------------------------
Private Sub cmdok_Click()
Dim S(20) As String
Dim i, j As Integer
'On Error GoTo ex
dbname = dbnametxt.Text
year = yeartxt.Text
dbname = dbname & year
'tablenametxt.Text = dbname & year
33
Set wrk = DBEngine.Workspaces(0)
Set db = CreateDatabase(dbname, dbLangGeneral, ";pwd" = " ")
MsgBox "database created.."
Unload Me
Load mainfrm
mainfrm.Show
Exit Sub
ex:
dbnametxt.Text = Clear
yeartxt.Text = Clear
tablenametxt.Text = Clear
MsgBox "database already exist"
Unload Me
End Sub
--------------------------------------------------------------------------------------------------------
Private Sub cmdok_GotFocus ()
'tablenametxt.Text = dbname & year
End Sub
--------------------------------------------------------------------------------------------------------
Private Sub Form Load ()
End Sub
Private Sub mnuFileExit_Click ()
Unload Me
Load mainfrm
34
End Sub
--------------------------------------------------------------------------------------------------------
Open Form:
Dim i, j As Integer
Dim sc, cr As Integer
Dim db As Database
Dim rs As Recordset
Dim cn As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
Dim str As String
--------------------------------------------------------------------------------------------------------
Private Sub Command1_Click ()
Set rs1 = New ADODB.Recordset
Dim a As New ADODB.Command
cid = Text1.Text
sid = Text2.Text
'*********when index is not full****************
nseat = Text3.Text
j = nseat - 1
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
a.CommandText = "SELECT STUDENT_ID FROM STUDENT_INFO WHERE
COURSE_ID='" & cid & "'"
35
a.ActiveConnection = cn
Set rs1 = a.Execute
For j = j To seat Step j + 2
'MsgBox j
If j > seat Then
Exit Sub
End If
If j > 0 Then
i = 0
While Not rs1.EOF And i < nrow
For i = 0 To nrow - 1
If j > 0 And i = 0 Then
rs.MoveFirst
End If
'MsgBox "seat " & j & i
rs.Edit
'MsgBox rs1.Fields(0)
rs.Fields (j) = rs1.Fields (0)
rs1.MoveNext
rs.Update
rs.MoveNext
If rs1.EOF Then
MsgBox "THERE IS NO MORE STUDENT", vbOKOnly + vbInformation,
"RECORD_INFORMATION"
36
str = MsgBox("DO YOU WANT TO ADD MORE STUDENT RECORD", vbYesNo
+ vbInformation, "RECORD_INFORMATION")
If str = 6 Then
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text1.SetFocus
Exit Sub
Else
Unload Me
Load Form4
Form4.Show
Exit Sub
End If
End If
Next i
Wend
Else
'MsgBox tb
i = 0
While Not rs1.EOF And i < nrow
37
For i = 0 To nrow - 1
'MsgBox "seat " & j & i
rs.AddNew
'MsgBox rs1.Fields(0)
rs.Fields(j) = rs1.Fields(0)
rs1.MoveNext
rs.Update
If rs1.EOF Then
Exit Sub
End If
Next i
Wend
End If
'MsgBox tb
'MsgBox "subdivision" & j
Next j
Set rs1 = Nothing
Unload Me
Load Form4
Form4.Show
'End
End Sub
--------------------------------------------------------------------------------------------------------
Private Sub Command2_Click()
38
Dim r As String
r = MsgBox ("ARE YOU WANT TO EXIT THE APPLICATION", vbYesNo +
vbQuestion, "SEATING ARRANGEMENT")
If r = 6 Then
End
End If
End Sub
--------------------------------------------------------------------------------------------------------
Private Sub Form Load ()
Set db = OpenDatabase (db1)
Set rs = db.OpenRecordset (tb)
Set cn = New ADODB.Connection
Set rs1 = New ADODB.Recordset
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=info.mdb"
cn.ConnectionString = "driver=Microsoft access driver (*.mdb);"
cn.Open "info.mdb"
Label1.Caption = tab
End Sub
--------------------------------------------------------------------------------------------------------
Add Table:
Dim dbt As Database
'Dim rst As Recordset
Private Sub Command1_Click ()
Dim S (20) As String
39
Dim i, j as Integer
'On Error GoTo ex
tablename = Text1.Text
ncol = Text2.Text
nsubcol = Text3.Text
nrow = Text4.Text
seat = ncol * nsubcol
'MsgBox seat
tb = tablename
Set tabldf = dbt.CreateTableDef (tablename)
For i = 1 To seat
S (i) = "seatid" & i
'MsgBox S (i)
With tabldf
'MsgBox i
.Fields. Append .CreateField(S (i), dbText)
End With
Next i
dbt.TableDefs.Append tabldf
'MsgBox "seat" & seat
MsgBox "Table created.."
Unload Me
Load Form2
Form2.Show
40
Exit Sub
'x:
'dbnametxt.Text = Clear
'yeartxt.Text = Clear
'tablenametxt.Text = Clear
'MsgBox "database already exists"
'Unload Me
End Sub
---------------------------------------------------------------------------------------------------
Private Sub Command2_Click()
End
End Sub
---------------------------------------------------------------------------------------------------
Private Sub Form_Load ()
Label5.Caption = db1
Set wrk = DBEngine.Workspaces (0)
Set dbt = OpenDatabase (db1)
End Sub
----------------------------------------------------------------------------------------------------
Student Form:
Dim dbt As Database
'Dim rst As Recordset
Private Sub Command1_Click()
Dim S(20) As String
41
Dim i, j As Integer
'On Error GoTo ex
tablename = Text1.Text
ncol = Text2.Text
nsubcol = Text3.Text
nrow = Text4.Text
seat = ncol * nsubcol
'MsgBox seat
tb = tablename
Set tabldf = dbt.CreateTableDef(tablename)
For i = 1 To seat
S(i) = "seatid" & i
'MsgBox S(i)
With tabldf
'MsgBox i
.Fields.Append .CreateField(S(i), dbText)
End With
Next i
dbt.TableDefs.Append tabldf
'MsgBox "seat" & seat
MsgBox "Table created.."
Unload Me
Load Form2
Form2.Show
42
Exit Sub
'x:
'dbnametxt.Text = Clear
'yeartxt.Text = Clear
'tablenametxt.Text = Clear
'MsgBox "database already exist"
'Unload Me
End Sub
-------------------------------------------------------------------------------------------------------
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Label5.Caption = db1
Set wrk = DBEngine.Workspaces(0)
Set dbt = OpenDatabase(db1)
End Sub
-------------------------------------------------------------------------------------------------------
Snapshots
1.Splash form:
43
The first page of application is Splash form. Splash form which shows the application is
loading their processing file and going to be start.
2.Login from:
44
Login form is used to accept the user information like
username and their respective password. It allows only authorized user who have the
permission to access this software.
3.mainform:
45
Main form which is the parent form of this application
helps us to create database for seating arrangement and room details where seat are
allocated.
4.Create datablase:
46
Create database form where user can make a database for seating arrangement.
And all the information related to seating plan like room detail and student allocated
to that room are store in this database.
5. Add_roomdetail from:
47
6.Add Record form
48
7. Student_record form:
49
8. Course_detail form:
50
References:
Evangelos Petroutsos, “Mastering Visual Basic 6”, BPB Publication.
Special edition using visual basic6 by Brian siler and Jeff Spotts.
Steven Holzner , “Visual Basic 6 Programming, Black Book”, The
DreamtechPress,reprint – 2004.
Ivan Bayross, “SQL, PL/SQL”, BPB Publications, 3rd Edition- 2005
http://www.daniweb.com/forums/thread5079.html#
51
http://www.freevbcode.com/ShowCode.asp?ID=468
http://www.softlookup.com/tutorial/data_vb/ch14.asp
http://www.bigresource.com/VB-VB6-Adding-Data-to-Access-Table-Field-
LHjUheDXJt.html
http://www.timesheetsmts.com/adotutorial.htm
52