project on visual basic 6.0 ' Jewellery Shop Management'

40,655 views

Published on

This project includes the features of a database that is adding,deleting,modifying and searching of a required record-are developed using MICROSOFT VISUAL BASIC 6.0 and ORACLE 8.0V

0 Comments
33 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
40,655
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
1,530
Comments
0
Likes
33
Embeds 0
No embeds

No notes for slide

project on visual basic 6.0 ' Jewellery Shop Management'

  1. 1. Jewellary Shop Management SYNOPSIS TITLE : JEWELLARY SHOP MANAGEMENT ABOUT THE PROJECT : Jewellary Shop Management is a user friendly application software which is used by the jewellary vendors to record the sales and stock of readymade,ordered ornaments,purchased by the customer. This project includes the features of a database that is adding,deleting,modifying and searching of a required record-are developed using MICROSOFT VISUAL BASIC 6.0 and ORACLE 8.0V.The main intension behind designing and developing this project is to enable has to transact in easy,and it also maintain the details about the available and outstanding stocks of gold and gems. This project handles the complete automation regarding the transactions.It also enables us to add records regarding new customer,new design ornaments and details about the ornaments too. The search facility provides a faster and easiest way of viewing the records.Upon all,this application is ‘Password protected’,which stands as firewall against all those intruders who tries to enter into our application.This package maintains all possible reports like ready ornaments bill report,ordered ornaments bill reports,customers detail report,gold detail report,gems detail report. The high degree of emphasis on adding,deleting.updating,manipulating in a user friendly manner,yet enginity,inspired,instinctive environment,which gives the users chance to stay cool in transaction and to excel amidst ever increasing complexity. CONTENTS S.S.I.T ,Tumkur. 1
  2. 2. Jewellary Shop Management 1. Introduction about project . 2. Why Visual Basic 6.0 ? 3. Introduction to Oracle . 4. Tables . 5. Screens . 6. Reports . 7. Source Code . 8. Date Flow Diagram . 9. Conclusion . 10. Bibiliography . S.S.I.T ,Tumkur. 2
  3. 3. Jewellary Shop Management INTRODUCTION ABOUT PROJECT A project on jewellary shop is a place where the customers are facilited with different types of ornaments . which may be is different fashions and values. It’s a necessity for the vendors that they need to record the images of their ornaments and S.S.I.T ,Tumkur. 3
  4. 4. Jewellary Shop Management current updated prices and other design details. I have developed a project to maintain a record of this by the name “ JEWELLARY SHOP MANAGEMENT “. In keeping view of the jewellary shop database requirements , I have developed this project using software package ORACLE as back-end and VISUAL BASIC 6.0 V as the front-end that contains the following forms for storing the details as follows : 1 . Jewellary form : This form maintains the images of the ornaments i.e., ornament name and the design number. 2 . Gold master form : This form maintains details regarding the gold i.e., gold id , type,price/gram,stock. 3 . Gems master form : this form holds information about gems i.e., gems id, gems name, amount, stock. 4 . Design details form : This form allows to enter the details of newly arrived ornaments i.e., ornament name, design number, gold id, ready item no, weight, price, wastage, gross amount. 5 . Ready item bill form : this formcontains the details of the ready made ornaments and cost. If we select a particular category of a jewellary we will get the clear-cut details about that design. M ore over, it also allows us to enter the details of customer who is buying it. –his custid, custname, address, phone. And can even continue with the same customer if needed. 6 . Ordered item bill form : This form maintains the wish list of the customer about the ornament, customer details who ordered that ornament and can here also allows to continue for the same customer . 7 . Bill detail form : This form informs about the transaction details. 8 . Query form : This is the most important form, because we can check the database in different ways by putting queries . we can get the more detailed information from this form. 9. Report : A report is an orderly and objective communication of factual information that serves a truncation purpose. My project having having 5 reports – S.S.I.T ,Tumkur. 4
  5. 5. Jewellary Shop Management 1. Ready bill report : This report summarizes the details of all the ready ornaments. 2. Ordered bill report : This report summarizes the details of all the ordered ornaments. 3. customer detail report : This gives summarized details about the customer. 4. Gold details report : This report summarizes the details of gold details. 5. Gems details report : This report summarizes the details about gems. Beside these forms other form for ,the entry of the password, reset backend is also being maintained . Jewellary Shop Management also has the following important features as listed below : • It is Menu-based i.e., Whenever the user wishes for particular form to open like ready item,ordered item can open and carry their work.if the user wants to add a new record into the database then,can click ‘ add’ /’insert’.The file menu also provides the user to save, cancel,exit,clear options. • It is being provided by the password facility i.e., to restrict the unauthorized users to access the database to enter into the database. • Our project provides extensive search facility.It searches for the users record from the database providing wide range of options. • The important feature report generation is also included in this project.It helps the user in generating the reports. The user can get a hardcopy of the required bil S.S.I.T ,Tumkur. 5
  6. 6. Jewellary Shop Management WHY VISUAL BASIC 6.0 ? Developers of today’s world always want to create effective and robust applications packed with impressive outlook in minimum time. programming using C and C++ was a pain to the programmer. Windows One had to write pages of code to display a very simple command button on the screen. Visual Basic makes the life of a programmer much easier by giving an Integrated Development Environment (IDE). Using Visual Basic, One can create various types of programs. One can create effective database programs with Visual Basic as the front-end tool. S.S.I.T ,Tumkur. 6
  7. 7. Jewellary Shop Management Graphics programming is another aspect of Visual Basic. One can create effective very easily here. Not only that, users can create their own controls that can be plugged in with other tools using ActiveX. One can also write effective Internet programs using Visual Basic. All these can do with minimum labor and time. Visual Basic is a highly interactive programming language. It has several features that allow the programmer to develop applications for MS-Windows in an easy and efficient manner. Visual Basic follows the standard syntax of basic, except that some new language features have been added to it to give more flexibility to the programmer. Visual Basic makes use of GUI for creating robust and powerful applications. The GUI which enable users to interact with an application. This feature makes it easier to comprehence things in a quicker and easier way. The integrated development environment: One of the most significant changes in Visual Basic 6.0 is the Integrated Development Environment (IDE). IDE is a term commonly used in the programming world to describe the interface and environment that we use to create our applications. It is called integrated because we can access virtually the entire development tool that we need from one screen called an interface. The IDE is also commonly referred to as the design environment, or the program. Integrated development is one in which we can develop, run, test and debug your applications. The visual basic IDE is made up of a number of components: ♦ Menu Bar ♦ Tool Bar ♦ Project Explorer ♦ Form Layout Window ♦ Toolbox ♦ Form Designer S.S.I.T ,Tumkur. 7
  8. 8. Jewellary Shop Management Menu Bar - This menu bar displays the commands that are  required to build and application. The main menu items have sub menu items can be chosen when needed. Tool Bar - The toolbar consists of picture buttons that are  shortcuts to some of the commonly used Menu items. It gives the quick access to commonly used menu commands. The tool bar is clicked once to carry out the action represented by it. Project Explorer - The window titled project is the project  explorer, which displays the Components of the project. Form Layout Window - The form layout window is used to  determine the Initial positions of the forms in your application. This window is useful in applications that use multiple forms. Tool Box- The toolbox contains a set of controls that are  used to place on a format design time their by creating the user interface area. Form Designer - The form designer is a main window in the  middle of the screen, and in it you can design and edit the applications user interface. The same window displays a text editor in which you can enter and edit the applications code. The form designer displays two windows for each form: ♦ The form itself(the elements of the visible user interface) ♦ A Code window (the code behind the elements of the form) Properties Window - The properties window is docked  under the project explorer window. It exposes the various characteristics of selected objects. Properties, Methods and Events: Property -A property is a named attribute of programming object. Properties define the characteristics of an object such as size, color etc or sometimes the way in which it behaves. For e.g., a Text box accepts properties such as Enabled, Font, Multi line, Text, Visible, Width etc. S.S.I.T ,Tumkur. 8
  9. 9. Jewellary Shop Management Method - A method is an action that can be performed on objects. In object oriented programming, a method is connected or built-in procedure, a block of code that can be invoked to impart some action on a particular object. Event Drive Programming Events determine the controls reactions to external conditions. They are various things that can happen in a program. In an event driven application, the program statements are executed only when a particular event calls a specific part of the code that is assigned to the event. Module - A module is set of set statements. Procedures - Procedures are building blocks of programs. A procedure is a named sequence of statements executed as unit and it instructs the application how to perform a certain task. Control structures - Control structures are programming statements that affect program execution, based on the outcome of some logical comparison. There are two types of control structures they are: 1. Decision Structures- These structures enable the program to make decisions on how it will operate based on test conditions. There are If-Then, If-Then-Else, Select case. 2. Looping Structures- These structures enable the program to execute a block of statement indefinite number of times based on a condition. They are while-wend, do loop, for next. Record set -A Record set object represents a base table or the records that results from running a query. The record set objects are used to manipulate the data in database at the record level. Menu Editor - to create new menus and menu bars, add new commands to existing menus, replace existing menu commands with your own commands and change and delete existing menus and menu bars. S.S.I.T ,Tumkur. 9
  10. 10. Jewellary Shop Management Popup Menus - a popup menu is floating menu is displayed over a form, independent of the menu bar. The item displayed on the pop-up menu depend on where the pointer was located when the right mouse button was passed there fore, popup menus are also called context menus. Multiple Document Interface (MDI): The multiple-document interface allows you to create an application that maintains multiple forms within single character form. An MDI application allows the user to display multiple documents at the same time, with each document displayed in its own window. Using the Grid Controls: The most common two-dimensional carry, a table is the best presented to user in row and column format. The grid control offers a convenient way for to display table data to the user. The users can navigate the tables values using scroll bars. Therefore, the grid control does not have to be large as the table, because the grid control displays scroll bars. Visual Basic includes two grid controls:  The Data Bound Grid (DBGrid)  The Flex Grid (MSFlex Grid) The data Bound Grid is better at displaying data retrieved directly from a Database. The Flex grid is better at displaying data in unbound mode. That is data supplied by the program. Flex Grid does offer some binding capability, but bound data must be read only table form. This is often the only practical way to display multiple set of data. An MSFlex Grid control in Visual Basic is used to create applications that present information in rows and columns. It displays information’s in cells. A cell is a location in the MSFlex Grid at which the row and column intersect. Almost every programmer uses a data grid for one project or another. A grid enables users to view and edit data in a scrollable table form. This is often the only practical way to display multiple set of data. Many other controls can make programming tasks easier. S.S.I.T ,Tumkur. 10
  11. 11. Jewellary Shop Management Some of the other frequently used controls that should include the following:  Status Bar: it is used to display the partitioned status bar we se at the bottom of the many popular applications.  Progress Bar: it is used to provide a graphical progress indicator during long operations.  Chart: it is used to create pie, bar, line and many other types of charts. ADO Data Control (ActiveX Data Objects Data Control) ADO uses a new a database system connection framework called OLEDE, which allows faster, more flexible access to multiple data providers, and ADO wraps it all into easy-to-use interface. This means that we can write database applications that can easily scale from single-user data bases such as access to complex client server systems as oracle or almost any other database that is either an OLEDB provider, or ODBC provider. The ADO control can access E-mail, Graphics and virtually any data source that might reside outside the application. The ADO connection object enables to crate a connection to a data provider of OLEDB. As soon as the connection established that could build enterprise solutions from the wide range of functionality supplied from the connection object. DATA ACCESS OPTIONS: Common data access options: With Visual Basic 6.0 Microsoft introduced a new data access options called RDO or Remote Data Objects. Unlike DAO, RDO requests are passed directly to ODBC so they can be preceded more efficiently. The features of RDO were limited, which made it difficult to use. A Microsoft solution was a new data access option, called ADO, or ActiveX Data objects. Like RDO, ADO requests aren’t processed by Jet, so it can take advantages of the features of many Client /server database. In addition, it is the preferred method for accessing data with Visual Basic 6.0; it is the method that we recommended for developing new applications. S.S.I.T ,Tumkur. 11
  12. 12. Jewellary Shop Management ADO is based on the object model that refers to data using the same syntax that use for referring to objects like forms and controls. Although RDO and DAO are also based on object modes. The ADO model is both simplified and improved Common options for accessing data from Visual Basic 6.0 Application DAO ADO RDO ODBC API JET OLE DB ODBC Data Source Object Linking and Embedding Data Base (OLEDB) OLEDB is a low level object oriented programming interface designing to access a wide variety of data sources. That is, OLEDB is not restricted to ISAM, jet or even relational data source but is capable of dealing with any type of data S.S.I.T ,Tumkur. 12
  13. 13. Jewellary Shop Management information regardless of its format or storage method. Can support both relational and non-relational data sources, including messages, File system and other non traditional data sources. OLEDB is not designed to be accessed directly from Visual Basic due to its complex interfaces but virtually all of OLEDB’s functionality is exposed by ADO. ActiveX Data Objects: ActiveX Data Objects is the object based interface OLEDB. Developers can now access an even broader variety of data sources using both OLEDB service providers and existing ODBC drivers through its OLEDB for ODBC intermediate interface. Native providers are supported for Oracle, SQL, Server, Jet and FoxPro and with more being released every day. ADO Object Model: ADO uses a new data bases connection frame work called OLEDB, which allows faster more flexible access to multiple data providers. ADO wraps it all in to one easy-to-use interface. The ADO Model is shown in the Figure Access Visual Basic Applic ation ADO LAN/ Internet/ Intranet OLEDB Oracle Exchange Data Environment and Data Report: Data Environment Design is an interactive, powerful interface introduced in Visual Basic 6.0 the Data Environment can be used, much like a Data control by binding other controls such as text box, label, check box to the designer. S.S.I.T ,Tumkur. 13
  14. 14. Jewellary Shop Management This designer can be controlled at design time by changing its properties or programmatically at run time. Data Environment Designer is a powerful, sophisticated interface, which provides an interactive, design time environment for creating programmed runtime access to data. Data Environment Designer is a new feature with visual Basic 6.0 it create connection and command objects that can use for building forms and developing reports with ADO. When the Designer window is opened for the first time for a project, one Data Environment object and one connection object are shown. To create a new connection object, click on the Add connection button in the designer tool bar or click on the arrange by objects toolbar button to display the connection folder, then right – click on that folder and select Add connection from its shortcut menu. Then, to establish the data source, either. 1) Choose a stored procedure, table or view. 2) Enter an SQL statement that does the query that user wants. Data Report: Data Report utility introduced for the first time in Visual Basic 6.0 is used to design reports. Data Report Designer is a flexible report generator that can create banded hierarchical reports. The fields can be dragged from the Data Environment Designer to the data report designer. The data report can be bound to any bound control, but it works well with Data Environment Object. Data Environment must include at least one connection object in it. A connection object represents a connection to a database that is used at the data source for the associated commands like tables or queries. To create a Data Report, select Add Data Report from the project menu, use the list for the Add toolbar button to select Data Report or use the shortcut menu for the project Explorer window. This opens the data report window with a report S.S.I.T ,Tumkur. 14
  15. 15. Jewellary Shop Management that contains five default sections; Report Header, Page Header, Detail, Page Footer and Report Footer. To associate the Data Report with the command object created, set the data source property of the report to the name of the Data Environment object that Contains the command object and set the Data member property to the name of the command object. OPEN DATABASE CONNECTIVIT(ODBC) Open database connectivity (ODBC) is a windows technology that lets database client applications connects to an external database. To use ODBC, the database vendor must provide an ODBC driver for data access. Once this driver is available, the client machine should be configured with this driver. The destination of the database, login it and password is also to be configured on every client machine. This is called as a data source. The user can configure multiple data sources with same or different drives on the same machine. Thus using ODBC, it is possible to access heterogeneous data from any client. In ‘Networking Operating system’ that manages the functions of the network, the server required a data base management system (DBMS) like Oracle or Microsoft SQL server. This DBMS manages the databases that are stored on the server. Although the application software is run on the client, it uses data that stored on the server. To make this communication between the client and the data source possible, the client requires an ODBC driver or OLEDGB provider. If an Oracle database is the data source, we can use either the ODBC driver or OLDEB provider for Oracle. S.S.I.T ,Tumkur. 15
  16. 16. Jewellary Shop Management Creating an ODBC Data Source: Before any application can access an ODBC database, the ODBC drivers must installed and a data Source Name (SN) created using the Control Panel. The DSN used whenever a reference is to an ODBC database. Steps have to follow to set up an oracle data source: 1. Double-click on the ODBC configuration open under control panel. 2. Here various data sources associated with various drivers exist. Our objective is to create a new data source using ODBC driver for Oracle. 3. Select the add button to as a new ODBC data source, Lists of ODBC drivers that are currently installed in the system are displayed. Select the ODBC driver for oracle. 4. Enter a name and description for the data source. 5. Click on the select button and find the Access database you want to use. After it is done, the path to the database should be displayed. 6. Click on the OK button that displays the data source administrator dialog box with the new data source. S.S.I.T ,Tumkur. 16
  17. 17. Jewellary Shop Management INTRODUCTION TO ORACLE S.S.I.T ,Tumkur. 17
  18. 18. Jewellary Shop Management Every business enterprise marinating large volumes of data for its operations. With more and more people accessing these data for their work the need to maintain its integrity and relevance increases. Normally, with the traditional methods of storing data and information in files, the chances that the data loses its integrity and validity are very high. Oracle 8.0 is an ‘Object Relational Database Management Systems’ (ORDBMS). It offers capabilities of both relation and object oriented database systems. Objects can be defined as reusable software codes with little or no change to the code. Oracle products are based on a concept known as the ‘client/server technology’. This concept involves segregating the processing of an application between two systems. One performs all activities related to the database (server) and the other performs activities that help the user to interact with the application (clients). A client or front-end database application also interacts with the database by requesting and receiving information from the database server. It acts as an interface between the user and the database. Further, it also checks for the validation against the data entered by the user. Data Base Management System: - A DBMS consist of inter related data and a set of programs to access that data. The collection of data is usually referred to as the database, contains information about one particular enterprise. The primary goal of a DBMS is to provide an environment that is both convenient an efficient to use in retrieving and storing database information An Overview of RDBMS:-there are three types of database management systems, namely network, hierarchical and relational. Relational database employs a relational structure and data are stored in the tables. In a table, the rows represent the unique entities or records and columns represent attributes. Records are access by the S.S.I.T ,Tumkur. 18
  19. 19. Jewellary Shop Management values stored in the columns of the table. Relations are specified using common columns in the tables. A modern relation database management system can perform wide array of tasks. It acts as a transparent interface between the physical storage and the logical presentation of data. It provides a set of flexible and sophisticated tools for handling information. Facilities provided by RDBMS are: • Define database. • Query the database. • Add, edit and delete data. • Modify the structure of the database. • Secure data from public access. • Communicates with in the network, export and import data SQL *Plus - it is a structured query language supported by Oracle through SQL *Plus we can store, retrieve, edit, enter and run SQL commands and PL/SQL blocks. PL/SQL - it is an extension of SQL.PL/SQL block can contain any number of SQL statements integrated with flow of control statements. Forms - this is a graphical tool used for generation and executing forms based applications. A form basically comprises blocks and fields. Reports - it is an application development tool of oracle for developing, executing, displaying and printing reports. Introduction to SQL - Oracle’s database language is SQL, which is used for storing and retrieving information in oracle. A table is a primary database object of SQL that is used to store data. A table holds data in the form of rows and columns. In order to communicate with the database, SQL supports the following categories of commands: • Data Definition Language-Creates, Alter, Drop, Commands. S.S.I.T ,Tumkur. 19
  20. 20. Jewellary Shop Management • Data Manipulation Language-Insert, Select, Delete and Update. • Transaction Control Language-Commit, Save point and rollback • Data Control Language-Grant and Revoke commands. Normalization Normalization is the process of removing redundancy. Here data are grouped in simplest way possible so that later changes can be made with a minimum impact on the data structure. S.S.I.T ,Tumkur. 20
  21. 21. Jewellary Shop Management TABLE STRUCTURE ADMINISTRATOR DETAILS: Name Null? Type ---------------------------------------------------------------------------------------USER_NAME VARCHAR2(10) PASSWORD VARCHAR2(10) S.S.I.T ,Tumkur. 21
  22. 22. Jewellary Shop Management DESIGN DETAILS: Name Null? Type ----------------------------------------------------------------------------------------NAME VARCHAR2(15) DESNO1 VARCHAR2(10) DESNO2 VARCHAR2(10) DESNO3 VARCHAR2(10) DESNO4 VARCHAR2(10) DESNO5 VARCHAR2(10) GOLD DETAILS: Name Null? Type ---------------------------------------------------------------------------------------GID TYPE PRICE_GRAM STOCK DESCPT NOT NULL VARCHAR2(5) VARCHAR2(15) NUMBER(5) NUMBER(5) VARCHAR2(25) GEMS DETAILS: Name Null? Type ---------------------------------------------------------------------------------------GEMSID NOT NULL VARCHAR2(5) GEMSNAME VARCHAR2(15) GEMSPRICE NUMBER(5) GSTOCK NUMBER(5) READY BILL DETAILS: Name Null? Type ---------------------------------------------------------------------------------------BNO NOT NULL VARCHAR2(5) BDATE DATE RINO VARCHAR2(5) RWT NUMBER(5) PRICE_GRAM NUMBER(5) PRICE NUMBER(5) WASTAGE NUMBER(5) RTOTPRICE NUMBER(5) CNO VARCHAR2(5) S.S.I.T ,Tumkur. 22
  23. 23. Jewellary Shop Management READY ITEMS DETAILS: Name Null? Type ---------------------------------------------------------------------------------------RINO NOT NULL VARCHAR2(5) GID VARCHAR2(5) RINAME VARCHAR2(15) RWT NUMBER(5) RPRICE NUMBER(5) WASTAGE NUMBER(5) RTOTPRICE NUMBER(5) ISTOCK NUMBER(5) ORDERED BILL DETAILS: Name Null? Type ---------------------------------------------------------------------------------------BNO NOT NULL VARCHAR2(5) BDATE DATE OINO VARCHAR2(5) TYPE VARCHAR2(15) PRICE_GRAM NUMBER(5) OINAME VARCHAR2(20) OWT NUMBER(5) TOTGOLDPRICE NUMBER(8) OPATT VARCHAR2(15) GEMSPRICE NUMBER(5) QTGEMS NUMBER(5) TOTGEMSPRICE NUMBER(5) GOLDP_GEMSP NUMBER(8) LABOUR NUMBER(5) WASTAGE NUMBER(5) TOT_AMT NUMBER(5) CNO VARCHAR2(5) CUSTOMER DETAILS: Name Null? Type ---------------------------------------------------------------------------------------CNO VARCHAR2(5) CNAME VARCHAR2(15) CADDR VARCHAR2(20) PHONE NUMBER(12) ORDERED SEQUENCE : Name Null? Type ---------------------------------------------------------------------------------------S.S.I.T ,Tumkur. 23
  24. 24. Jewellary Shop Management SNO NUMBER(5) READY SEQUENCE NO: Name Null? Type ---------------------------------------------------------------------------------------SNO NUMBER(5) ORDERED CUSTOMER SEQUENCE: Name Null? Type ---------------------------------------------------------------------------------------SNO NUMBER(5) SEQUENCE NO: Name Null? Type ---------------------------------------------------------------------------------------SNO NUMBER(5) S.S.I.T ,Tumkur. 24
  25. 25. Jewellary Shop Management S.S.I.T ,Tumkur. 25
  26. 26. Jewellary Shop Management S.S.I.T ,Tumkur. 26
  27. 27. Jewellary Shop Management S.S.I.T ,Tumkur. 27
  28. 28. Jewellary Shop Management S.S.I.T ,Tumkur. 28
  29. 29. Jewellary Shop Management S.S.I.T ,Tumkur. 29
  30. 30. Jewellary Shop Management S.S.I.T ,Tumkur. 30
  31. 31. Jewellary Shop Management S.S.I.T ,Tumkur. 31
  32. 32. Jewellary Shop Management S.S.I.T ,Tumkur. 32
  33. 33. Jewellary Shop Management S.S.I.T ,Tumkur. 33
  34. 34. Jewellary Shop Management SOURCE CODE GoldMaster Code : Dim db As New ADODB.Connection Dim com As New ADODB.Command Dim rs1 As New ADODB.Recordset Private Sub Command1_Click() Dim rs As New ADODB.Recordset com.ActiveConnection = db com.CommandType = adCmdText com.CommandText = "insert into goldmaster values('" & Text1.Text & "','" & Text2.Text & "'," & Text3.Text & "," & Text4.Text & ",'" & Text5.Text & "')" rs.Open "select * from goldmaster where gid='" & Text1.Text & "'", db, adOpenStatic, adLockReadOnly If Not rs.EOF Then MsgBox "already exist" Else com.Execute MsgBox "one record inserted" End If End Sub Private Sub Command2_Click() Dim rs As New ADODB.Recordset com.ActiveConnection = db com.CommandType = adCmdText com.CommandText = "update goldmaster set type='" & Text2.Text & "',price_gram=" & Text3.Text & ",stock=" & Text4.Text & ", descpt='" & Text5.Text & "' where gid='" & Text6.Text & "' " com.Execute MsgBox "one record updated" End Sub Private Sub Command3_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" End Sub Private Sub Command4_Click() S.S.I.T ,Tumkur. 34
  35. 35. Jewellary Shop Management db.Close Unload Me End Sub Private Sub Command5_Click() rs1.Open "select * from goldmaster where gid='" & Text6.Text & "'", db, adOpenStatic, adLockReadOnly If Not rs1.EOF Then Text1.Text = rs1!gid Text2.Text = rs1!Type Text3.Text = rs1!price_gram Text4.Text = rs1!stock Text5.Text = rs1!descpt rs1.Close Else MsgBox "record not found" rs1.Close End If End Sub Private Sub Command6_Click() DataGrid1.ScrollBars = dbgVertical Dim rs As New ADODB.Recordset rs.Open "select * from goldmaster", db, adOpenStatic, adLockReadOnly If Not rs.EOF Then Set DataGrid1.DataSource = rs Else MsgBox " no records " End If End Sub Private Sub Form_Load() db.Open "dsn=jew;uid=kavi;pwd=kavi" MsgBox "backend connected" End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or (KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then KeyAscii = 0 End If End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8 Or (KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122)) Then MsgBox "only no,char" S.S.I.T ,Tumkur. 35
  36. 36. Jewellary Shop Management KeyAscii = 0 End If End Sub Private Sub Text3_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8 Or KeyAscii = 46) Then MsgBox "only numbers" KeyAscii = 0 End If End Sub Private Sub Text4_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then KeyAscii = 0 End If End Sub Private Sub Text5_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or KeyAscii = 8 Or KeyAscii = 32) Then MsgBox "pleas enter only characters" KeyAscii = 0 End If End Sub Private Sub Text6_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or (KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then KeyAscii = 0 End If End Sub Gems Master Code : Dim db As New ADODB.Connection Dim com As New ADODB.Command Private Sub Command1_Click() Dim rs As New ADODB.Recordset com.ActiveConnection = db com.CommandType = adCmdText com.CommandText = "insert into gemsmaster values('" & Text1.Text & "','" & Text2.Text & "'," & Text3.Text & "," & Text4.Text & ")" S.S.I.T ,Tumkur. 36
  37. 37. Jewellary Shop Management rs.Open "select * from gemsmaster where gemsid='" & Text1.Text & "'", db, adOpenStatic, adLockReadOnly If Not rs.EOF Then MsgBox "already exist" Else com.Execute MsgBox "one record inserted" End If com.CommandText = "commit" com.Execute End Sub Private Sub Command2_Click() com.ActiveConnection = db com.CommandType = adCmdText com.CommandText = "update gemsmaster set GEMSNAME ='" & Text2.Text & "', GEMSPRICE=" & Text3.Text & ",gstock=" & Text4.Text & " where GEMSID='" & Text5.Text & "' " com.Execute MsgBox "one record updated" com.CommandText = "commit" com.Execute End Sub Private Sub Command3_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" End Sub Private Sub Command4_Click() com.ActiveConnection = db com.CommandType = adCmdText com.CommandText = "delete from gemsmaster wherer gemsid='" & Text5.Text & "' " com.Execute MsgBox "one record updated" com.CommandText = "commit" com.Execute End Sub Private Sub Command5_Click() Dim rs1 As New ADODB.Recordset rs1.Open "select * from gemsmaster where GEMSID='" & Text5.Text & "' ", db, adOpenStatic, adLockReadOnly If Not rs1.EOF Then Text1.Text = rs1!GEMSID S.S.I.T ,Tumkur. 37
  38. 38. Jewellary Shop Management Text2.Text = rs1!GEMSNAME Text3.Text = rs1!GEMSPRICE Text4.Text = rs1!GSTOCK Else MsgBox "record not found" End If rs1.Close End Sub Private Sub Command6_Click() db.Close Unload Me End Sub Private Sub Form_Load() Dim rs1 As New ADODB.Recordset db.Open "dsn=jew;uid=kavi;pwd=kavi" MsgBox "backend connected" rs1.Open "select * from gemsmaster", db, adOpenStatic, adLockReadOnly While Not rs1.EOF List1.AddItem rs1!GEMSID rs1.MoveNext Wend rs1.Close End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or (KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then KeyAscii = 0 End If End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8 Or (KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122)) Then MsgBox "only no,char" KeyAscii = 0 End If End Sub Private Sub Text3_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8 Or KeyAscii = 46) Then MsgBox "only numbers" KeyAscii = 0 S.S.I.T ,Tumkur. 38
  39. 39. Jewellary Shop Management End If End Sub Private Sub Text4_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then KeyAscii = 0 End If End Sub Private Sub Text5_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or (KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then KeyAscii = 0 End If End Sub ReadyItem Code : Dim db As New ADODB.Connection Dim com As New ADODB.Command Dim msno, rep As Integer Dim bch, cch As String Private Sub Command2_Click() db.Close Unload Me End Sub Private Sub Command3_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" Text9.Text = "" End Sub Private Sub Command4_Click() If MsgBox("are you sure ", vbInformation + vbYesNo, "reservation") = vbYes Then rep = 1 Call update_rbno Else Command4.Enabled = False End If S.S.I.T ,Tumkur. 39
  40. 40. Jewellary Shop Management End Sub Private Sub Combo1_Click() Dim goldid As String Dim rsrd As New ADODB.Recordset Dim rsgm As New ADODB.Recordset Dim rsgems As New ADODB.Recordset Dim rs1 As New ADODB.Recordset rs1.Open "select * from design where name='" & Combo1.Text & "' ", db, adOpenStatic, adLockReadOnly If Not rs1.EOF Then Combo2.AddItem rs1!DESNO1 Combo2.AddItem rs1!DESNO2 Combo2.AddItem rs1!DESNO3 Combo2.AddItem rs1!DESNO4 Combo2.AddItem rs1!DESNO5 End If rs1.Close rsrd.Open "select * from readyitems where riname='" & Combo1.Text & "' ", db, adOpenStatic, adLockReadOnly If Not rsrd.EOF Then Text4.Text = rsrd!rino Text5.Text = rsrd!rwt Text9.Text = rsrd!rprice Text10.Text = rsrd!wastage Text11.Text = rsrd!rtotprice goldid = rsrd!gid End If rsgm.Open "select * from goldmaster where gid= '" & goldid & "'", db, adOpenStatic, adLockReadOnly If Not rsgm.EOF Then Text1.Text = rsgm!gid Text2.Text = rsgm!Type Text3.Text = rsgm!price_gram End If 'rs2.Open "select * from readyitems where rino='" & Combo1.Text & "' ", db, adOpenStatic, adLockReadOnly 'If Not rs2.EOF Then End Sub Private Sub Command1_Click() Dim ch As String Dim rs As New ADODB.Recordset S.S.I.T ,Tumkur. 40
  41. 41. Jewellary Shop Management com.ActiveConnection = db com.CommandType = adCmdText com.CommandText = "insert into readybill values('" & Text14.Text & "',to_date('" & Text6.Text & "','mm/dd/yyyy'),'" & Text4.Text & "'," & Text5.Text & "," & Text3.Text & "," & Text9.Text & "," & Text10.Text & "," & Text11.Text & " ,'" & Text7.Text & "' )" com.Execute MsgBox "record is insert into ready bill table" If rep = 0 Then com.CommandText = "insert into cust values('" & Text7.Text & "','" & Text8.Text & "','" & Text12.Text & "'," & Text13.Text & ")" com.Execute MsgBox "record is insert into cust table " End If Com.CommandText = "update seqno set sno=" & msno & " " com.Execute com.CommandText = "update readyitems set istock=istock-1 where riname='" & Combo1.Text & "'" com.Execute com.CommandText = "commit" com.Execute MsgBox "stock updated" End Sub Function update_rbno() Dim rs3 As New ADODB.Recordset rs3.Open "select sno from seqno ", db, adOpenStatic, adLockReadOnly If Not rs3.EOF Then msno = rs3!sno End If bch = "b" msno = msno + 1 bch = bch & msno Text14.Text = bch End Function Private Sub Form_Load() Dim rs1 As New ADODB.Recordset Dim rs2 As New ADODB.Recordset db.Open "dsn=jew;uid=kavi;pwd=kavi" MsgBox "backend connected" rs1.Open "select * from readyitems", db, adOpenStatic, adLockReadOnly While Not rs1.EOF Combo1.AddItem rs1!riname rs1.MoveNext Wend rs1.Close Text.Txt = Date S.S.I.T ,Tumkur. 41
  42. 42. Jewellary Shop Management rs2.Open "select sno from seqno ", db, adOpenStatic, adLockReadOnly If Not rs2.EOF Then msno = rs2!sno End If bch = "b" cch = "rc" msno = msno + 1 bch = bch & msno cch = cch & msno Text14.Text = bch Text7.Text = cch End Sub Private Sub Text12_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or KeyAscii = 8 Or KeyAscii = 32 Or KeyAscii = 13 Or KeyAscii = 44 Or KeyAscii = 64 Or KeyAscii = 46) Then MsgBox "please enter only characters" KeyAscii = 0 End If End Sub Private Sub Text13_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then MsgBox "please numbers only " KeyAscii = 0 End If End Sub Private Sub Text3_Change() Text9.Text = Val(Text5.Text) * Val(Text3.Text) Text11.Text = Val(Text9.Text) + Val(Text10.Text) End Sub Private Sub Text7_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or (KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then KeyAscii = 0 End If End Sub Private Sub Text8_KeyPress(KeyAscii As Integer) 'select init cap (cname) from cust If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or KeyAscii = 8 Or KeyAscii = 46) Then MsgBox "please enter only characters" KeyAscii = 0 S.S.I.T ,Tumkur. 42
  43. 43. Jewellary Shop Management End If End Sub OrderedItem Code : Dim db As New ADODB.Connection Dim com As New ADODB.Command Dim bch As String Dim cch As String Dim och As String Dim msno, ocsno, mqty, nqty As Integer Dim rep As Integer Private Sub Command1_Click() Dim rs1 As New ADODB.Recordset Dim rs2 As New ADODB.Recordset f1 = 0 com.ActiveConnection = db com.CommandType = adCmdText If MsgBox("are you sure ", vbInformation + vbYesNo, "reservation") = vbYes Then rs1.Open "select * from orderedbill where bno='" & Text14.Text & "' ", db, adOpenStatic, adLockReadOnly If Not rs1.EOF Then f1 = 1 MsgBox "this bill no already exists" Exit Sub End If If f1 = 0 Then com.CommandText = "insert into orderedbill values('" & Text14.Text & "',to_date('" & Text15.Text & "','mm/dd/yyyy'),'" & Text1.Text & "', '" & Combo1.Text & "' ," & Text5.Text & ", '" & Text3.Text & "'," & Text4.Text & "," & Text16.Text & ",'" & Combo2.Text & "'," & Text2.Text & "," & Text17.Text & "," & Text18.Text & "," & Text11.Text & "," & Text7.Text & "," & Text8.Text & "," & Text9.Text & ",'" & Text13.Text & "' )" com.Execute MsgBox "record is inserted into orderedbill table" If rep = 0 Then com.CommandText = "insert into cust values('" & Text13.Text & "','" & Text6.Text & "','" & Text10.Text & "'," & Text12.Text & ")" MsgBox "record is inserted into cust table" com.Execute End If com.CommandText = "update oseq set sno=" & msno & " " com.Execute com.CommandText = "update ocustseq set sno=" & ocsno & " " S.S.I.T ,Tumkur. 43
  44. 44. Jewellary Shop Management com.Execute com.CommandText = "update gemsmaster set gstock=gstock-" & mqty & " where gemsname='" & Combo2.Text & "'" com.Execute com.CommandText = "update goldmaster set stock=stock-" & nqty & " where type ='" & Combo1.Text & "'" com.Execute com.CommandText = "commit" com.Execute Command4.Enabled = True End If End If End Sub Private Sub Command2_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" Text9.Text = "" Text10.Text = "" End Sub Private Sub Command3_Click() Unload Me End Sub Private Sub Combo1_Click() Dim rsgm As New ADODB.Recordset rsgm.Open "select * from goldmaster where type= '" & Combo1.Text & "' ", db, adOpenStatic, adLockReadOnly If Not rsgm.EOF Then Text5.Text = rsgm!price_gram End If End Sub Private Sub Combo2_Click() Dim rsgems As New ADODB.Recordset rsgems.Open "select * from gemsmaster where gemsname='" & Combo2.Text & "' ", db, adOpenStatic, adLockReadOnly If Not rsgems.EOF Then S.S.I.T ,Tumkur. 44
  45. 45. Jewellary Shop Management Text2.Text = rsgems!GEMSPRICE End If End Sub Function update_bno_ono() Dim rs3 As New ADODB.Recordset rs3.Open "select sno from oseq ", db, adOpenStatic, adLockReadOnly If Not rs3.EOF Then msno = rs3!sno End If bch = "b" cch = "oc" och = "o" msno = msno + 1 bch = bch & msno och = och & msno Text14.Text = bch Text1.Text = och End Function Private Sub Command4_Click() If MsgBox("are you sure ", vbInformation + vbYesNo, "reservation") = vbYes Then rep = 1 Call update_bno_ono Else Command4.Enabled = False End If End Sub Private Sub Form_Load() Dim rs1 As New ADODB.Recordset Dim rs2 As New ADODB.Recordset Dim rs3 As New ADODB.Recordset rep = 0 Command4.Enabled = False Text15.Text = Date db.Open "dsn=jew;uid=kavi;pwd=kavi" MsgBox "backend connected" rs3.Open "select sno from oseq ", db, adOpenStatic, adLockReadOnly If Not rs3.EOF Then msno = rs3!sno End If rs3.Close rs3.Open "select sno from ocustseq ", db, adOpenStatic, adLockReadOnly S.S.I.T ,Tumkur. 45
  46. 46. Jewellary Shop Management If Not rs3.EOF Then ocsno = rs3!sno End If rs3.Close bch = "b" cch = "oc" och = "o" msno = msno + 1 ocsno = ocsno + 1 bch = bch & msno cch = cch & ocsno och = och & msno Text14.Text = bch Text13.Text = cch Text1.Text = och rs1.Open "select type from goldmaster", db, adOpenStatic, adLockReadOnly While Not rs1.EOF Combo1.AddItem rs1!Type r1.MoveNext Wend rs2.Open "select gemsname from gemsmaster", db, adOpenDynamic, adLockReadOnly While Not rs2.EOF Combo2.AddItem rs2!GEMSNAME rs2.MoveNext Wend End Sub Private Sub Text10_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or KeyAscii = 8 Or KeyAscii = 32 Or KeyAscii = 13 Or KeyAscii = 44 Or KeyAscii = 64 Or KeyAscii = 46) Then MsgBox "please enter only characters" KeyAscii = 0 End If End Sub Private Sub Text12_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then MsgBox "please numbers only " KeyAscii = 0 End If End Sub Private Sub Text13_KeyPress(KeyAscii As Integer) S.S.I.T ,Tumkur. 46
  47. 47. Jewellary Shop Management If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or (KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then KeyAscii = 0 End If End Sub Private Sub Text17_LostFocus() Text18.Text = Val(Text2.Text) * Val(Text17.Text) mqty = Val(Text17.Text) End Sub Private Sub Text18_LostFocus() Text11.Text = Val(Text16.Text) + Val(Text18.Text) Text7.SetFocus End Sub Private Sub Text4_LostFocus() Text16.Text = Val(Text5.Text) * Val(Text4.Text) nqty = Val(Text4.Text) End Sub Private Sub Text6_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Or KeyAscii = 8 Or KeyAscii = 46) Then MsgBox "please enter only characters" KeyAscii = 0 End If End Sub Private Sub Text7_LostFocus() Text8.SetFocus End Sub Private Sub Text8_LostFocus() Text9.Text = Val(Text11.Text) + Val(Text7.Text) + Val(Text8.Text) End Sub S.S.I.T ,Tumkur. 47
  48. 48. Jewellary Shop Management S.S.I.T ,Tumkur. 48
  49. 49. Jewellary Shop Management CONCLUSION The project titled “Jewellary Shop Management” developed under Windows environment using Visual Basic is an attempt to implement the proposed system. S.S.I.T ,Tumkur. 49
  50. 50. Jewellary Shop Management The main objective of the project is to computerize the existing system where all the process was carried out manually. I had put my sincere effort to implement this project. Full attempt is made to make the software bug free but as we know “to error is human”. S.S.I.T ,Tumkur. 50
  51. 51. Jewellary Shop Management BIBILOGRAPHY 1. Guide to Visual Basic 6.0 -By Peter Norton’s 2. Murach’s Visual Basic 6.0 -By Ed Koop Anne Prince Joel Murach 3. Visual Basic 6 in 21 days -By Gerg Perry 4. Data Base management system -By Elmasuri and Navathe -By Korth 5. Fundamental of Data Base system S.S.I.T ,Tumkur. 51
  52. 52. Jewellary Shop Management -By Ramez Elmasri and Shamkamtt B Navathe 6. Data Base system concept -By Henry F Korth and Abraham Silberschatz. S.S.I.T ,Tumkur. 52

×