Sunteți pe pagina 1din 22

On

Visual Basic
ADO Data Control

Submitted To :
Ms. Shabeena Malik

Submitted By :
Asiya Rehman

Every work. However big or small is a result of join effort of a lot of people. This Project is also the same First of all I would like to thanks our principal Mrs. Reena Francis for her efforts provide us a harmonious for providing environment our thanks go to respected faculties me useful literature and books at the time of crisis. In the end I am also thankful to our Ms. Shabeena Malik for there uidance and kind co!operation. It would have been

impossible for me to complete this project report without her help and valuable suggestion providing me useful literature " books at the time of crisis
Student

Asiya Rehman

Certificate
This is to certify that Asiya Rehman studying in Class 12 Section B in academic session 2012-13 of the institution has completed project report on Computer as re uirement of practical e!am The "or# has $een carried to our entire satisfaction under our guidance and super%ision& 'ecturer in charge )s Sha$eena )ali# *ate +rade (rincipal

I D!"
INTRODUCTION
I#T$%&'(TI%# %$ )#I*)TI%# P$%FI+E

SYSTEM DESIGN AND DEVELOPMENT


I#T$%&'(TI%# T% ,-,TE. &E,I # PH),E, %F SDLC

RIEF INTRODUCTION TO SOFT!ARE USED


/I#&%/, 01 %$ 'PPE$ 2E$,I%# 2I,')+ 3),I( ), F$%#T!E#& .,!)((E,,

ADO CONTROL "ARD!ARE AND SOFT!ARE RE#UIREMENTS I LIOGRAP"Y

INTRODUCTION TO SYSTEM DESIGN ,ystem design is a solution4 a 5how to6 approach to the creation of the new system. This important phase is composed of the several steps. It provides the understandings and procedural details necessary for implementing the system recommended in feasibility study. Emphasis is on translating the performance re7uirements into design specification. &esign goes through logical and physical stages of development. +ogical designs reviews the present physical system4 prepares input and output specification4 make edit security and control specification4 details the implementation plan and prepares a logical design walkthrough. The physical design makes out the details of the physical system4 plans the system implementation devices a test and implementation plan and specifies any new hardware and software. Implementation4 planning4 system test preparation4 system interfaces specification and user documentation. 8. &ata 3ase &esign9 ! This activity deals with the design of the physical database. ) key is to determine how the access paths are to be implemented. ) physical path is derived from a logical path. :. Programs &esign9 ! In conjunction with the database design is a decision on the programming language to be used and the flowcharting and debugging procedure prior to conversion. ;. ,ystems and Programs Test Preparation9 ! Each aspect of the system has a separate test re7uirement. ,ystem testing is done after all programming and testing are completed the test cases cover every aspect of the candidate system actual operation4 user interface and so on. <. ,ystem Interface ,pecification9 ! This phase specifies for the user how information should enter and leave the system.

ERROR "ANDLING

In$ut Desi%n& Inaccurate input data are the most common cause of error in
data processing. To identify and correct errors the following must be done. DEVELOPMENT ACTIVITIES&' ,everal development activities are carried out during structured design. Those are following9!
8

Pr(cess (f desi%n
The design phase focuses on the detail implementation of the system recommended in the feasibility study. Emphasis is on translating the performance specifications into design specifications. The design phase is a transition from a user!oriented document to a document oriented to the programmers or data base personnel.

Re)uire*ents (f f(r* desi%n


i. Identification and wording. ii. .a=imum readability and use. iii. Physical factor. iv. %rder of data items. v. Ease of data entry. vi. ,i>e and arrangement forms. vii.'se of instructions. 2iii.Efficiency considerations.

8.

Output Design: (omputer outputs are most important and direct source of information to the user. Efficient4 intelligible output design should improve the system?s relationship with the user and help in decision making. ) major form of output in a hard copy from the printer. Printout should be designed around the output re7uirement of the user.

:.

Form design:The data4 the forms carry come from people and the informational output the system goes to the people. The physical carrier of data of information. It also can constitute authority for action. Each from is a re7uest for an action. It provides information for making decision and improving operations. .anipulate4 describe and manage data.

e. Testin%&'

#o system design is ever perfect. ) system is tested for online response4 volume of transaction4 stress4 recovery from failure and usability. ,ystem testing re7uires a test plan that consists of several key activities and steps for programs4 string4 system and user acceptance testing. Testing is the process to check the system to find out any error that many cause the system some trouble or hamper the integrity of the data. PREPERATION OF T"E TEST PLAN ,oftware testing is the process of e=ecuting a program with the intent of finding an error. ) good test has a high probability of finding a yet undiscovered error. The test data was prepared keeping in mind the user re7uirement and e=pectation. MET"OD USED TO TEST DATA 8. Test data was keened in through the data entry screen in the database. :. Input@output was carried to ensure proper functioning of the system. It was confirmed that all the re7uired validation and check are performed by giving invalid data input. ;. Testing for suitable error message@messages was done in case of invalid data entry. <. Testing for proper report layout. TESTING MET"OD 8 UNIT TESTING :- This type of testing involve individual testing of programs with respect to the desired e=pected output proper care is taken when entering the data checks were made to see that the data entered is correct and not of the specified bondAsB4 proper error message are flashed when an error occurs.

: SYSTEM TESTING: - In this phase the system as a whole is tested. This testing phase will check the integrity of the data while it was transferred from one process to another. The interaction between the modules was checked to see whether a module procedure the re7uired output4 which would be needed as input of another one.
e.

I*$+e*entati(n& '
This is crucial phase of system development .It involves introduction of new system into operation. This involves creating computer awareness on to job4 training4 installation of hardware4 terminal if does not e=ist4 client communication e7uipment before the system is up and made operational. 'ser manuals are prepared and user is trained in its use. 3efore implementation system was working manually. Few people were developed to run the computeri>ed system. &ata was fed at regular interval and monitories on basis of report and output. )ll the possible errors were recorded rectify and rested. The system after proper security and satisfaction was stepped in to ne=t phase employees were given ade7uate training4 about how to handle the system.

f.

P(st'i*$+e*entati(n and Maintenance&'


)fter the installation phase is completed and the user staff is adjusted to the changes created by the candidate system4 the evaluation and maintenance begin. +ike any system4 there is an aging process that re7uires periodic maintenance of Hardware " ,oftware. If the new information is inconsistent with the designed specification then changes have to be incorporated in the ,oftware. Hardware also re7uires periodic maintenance to keep in tune with designed specification.

TO SOFT!ARE USED
A OUT OPERATING SYSTEM !INDO!S ,In order to understand the application development process4 it is helpful to understand some of the key concepts upon which 2isual 3asic is build because 2isual 3asic is a windows development language4 so some familiarity with the /indows environment is necessary.
) complete description of the inner working of /indows would re7uire an entire book. ) simplified working of the /indows involves three key concepts9!

. !ind(/s 0 E1ents 2 Messa%es


/indows can be thought of simply as a rectangular region with its own boundaries. There are several different types of /indows9 8 )n e=plorer window in /indows 01 : ) document window within our word processing program %$ ; ) dialog bo= that pops up of remind us of an appointment Icons4 Te=t bo=es4 %ption buttons and menu bar all /indows. The .icrosoft /indows % ., manages all of these many windows by assigning each one a uni7ue I& no. the system continually monitors each of these windows for sign of activity or events. Events can occur through user action such as a mouse click or a key press4 through programmatic control4 or events as a result of another window action.

)3%'T F$%#T!E#&

VISUAL ASIC
The 5VISUAL part refers to the methods used to create the raphical 'ser Interface A 'IB. $ather than writing numerous lines of code we simply drag and drop pre!build objects into place on the screen. The 5BASI 6 part refers to the 3),I( A3eginners )ll Purpose ,ymbolic Instruction (odeB language4 a language used by more programmers. 23 has evolved from original 3),I( language and now contains several more than hundred statements4 functions and keywords4 many of which relate directly to /indows AGUIB. 3eginners can create useful application by learning just a few of the keywords. /hether our goal is to create a small utility for our workgroup or a large enterprise!wide system4 ourselves or even distributed applications spanning the globe via the Internet4 23 has the tool we need. 8 &ata access features allow us to create database " front!end application for most popular database formats. : )ctiveC technology allows us to use the functionality provided by other applications4 such as .icrosoft /ord word processor4 .icrosoft E=cel spreadsheet and other /indows application. ; Internet capabilities make it easy to provide access to documents and applications across the Internet from within our document. < %ur finished application is true .e=e file that uses a runtime &ynamic +ink +ibrary A&++B that we can freely distribute.

UNDERSTANDING T"E EVENT DRIVEN MODEL


In traditional or procedural applications the application itself controls which portion of the code to e=ecute and in which se7uence. In an event driven application4 the code does not follow a predetermined path it e=ecutes different code sections in response to events. Events can be triggered by user action4 by messages from the system or other

applications. The se7uence of these events determines the se7uence in which the code e=ecutes each time program runs. %ur code can also trigger events during e=ecution4 or it is important to understand to the event driven model.

INTERACTIVE DEVELOPMENT
The traditional application development process can be broken into three steps. /hich are as follows9! 8 /riting : (ompiling ; Testing the code unlike traditional language4 23 uses an interactive approach. /ith most languages4 if we make a mistake the error is caught by the compiler when we start compiling our application. /e must then find and fi= the errors and then start the compile cycle again4 repeating the process for each error. 23 interprets our code as we enter it4 catching and highlighting the errors. 23 also compiles the code as we enter. /hen we are ready to e=ecute the code there is no delay in compiling.

ELEMENTS OF IDE

23 is referred to as the ,*.,ntegrated *e%elopment -n%ironment/ because it integrates many


The working environment in functions such as design4 coding4 editing4 compiling4 and debugging the error and immediate windows for different purposes within a single environment.

FORMS AND CONTROLS The first step to creating an application using 23 is to create the interface i.e. the visual part of the application that the user interacts with forms and controls are the basic building block used to create the interface. . FORMS &' Forms are objects that process properties that define their appearance4 methods that define their behavior4 and events which define their interaction with the user. 3y setting the properties of the form and writing 23 code to respond to its events we can customi>e the objects to meet the re7uirements of our application.

0 CONTROLS &'
(ontrols are objects that are contained within form objects. Each type of control has it?s own properties4 methods and events that make it suitable for a particular purpose. ,ome of these controls we use in our application are best suited for entering or displaying te=t. %ther controls let us access other applications and process data as if the remote application was part of our code. PRO3ECT LIMATIONS ,ingle project can contain up to ;:4DDD identifiers which include forms4 controls4 modules4 variables4 constraints4 procedures4 functions and objects. 2ariables name no longer than :EE characters and the names of forms4 controls4 modules and classes cannot be longer than <D characters. The amount of code that can be loaded into a form is limited to FE4E;< lines. ) single line code can consist of 8D:; bytes.

ADO Data Control


The ADO Data control uses Microsoft ActiveX Data Objects (ADO) to quickly create connections between data bound controls and data !roviders" Data bound controls are any controls that feature a Data#ource !ro!erty" Data !roviders can be any source written to the O$% D& s!ecification" 'ou can also easily create your own data !rovider usin( )isual &asic*s class +odule" Althou(h you can use the ActiveX Data Objects directly in your a!!lications, the ADO Data control has the advanta(e of bein( a (ra!hic control (with &ack and -orward buttons) and an easy to use interface that allows you to create database a!!lications with a +ini+u+ of code" #i$ure %.& The ADO Data Control

#everal of the controls found in )isual &asic*s Toolbo. can be data bound, includin( the Check&o., Co+bo&o., /+a(e, $abel, $ist&o., 0icture&o., and Te.t&o. controls" Additionally, )isual &asic includes several data bound ActiveX controls such as the Data1rid, DataCo+bo, Chart, and Data$ist controls" 'ou can also create your own data bound ActiveX controls, or !urchase controls fro+ other vendors" 0revious versions of )isual &asic featured the intrinsic Data control and the 2e+ote Data control (2DC) for data access" &oth controls are still included with )isual &asic for backward co+!atibility" 3owever, because of the fle.ibility of ADO, it*s reco++ended that new database a!!lications be created usin( the ADO Data Control" #or More In'ormation A co+!lete list of data bound controls can be found in 4Controls That &ind to the ADO Data Control"4 To find out how to use the intrinsic Data control or the 2e+ote Data control, see 45sin( the Data Control4 or 45sin( the 2e+ote Data Control"4 -or details about creatin( a data !rovider, see 4Creatin( Data Aware Classes"4

0ossible 5ses

Connect to a local or re+ote database" O!en a s!ecified database table or define a set of records based on a #tructured 6uery $an(ua(e (#6$) query or stored !rocedure or view of the tables in that database" 0ass data field values to data bound controls, where you can dis!lay or chan(e the values" Add new records or u!date a database based on any chan(es you +ake to data dis!layed in the bound controls"

To create a client, or front end database a!!lication, add the ADO Data control to your for+s just as you would any other )isual &asic control" 'ou can have as +any ADO Data controls on your for+ as you need" &e aware, however, that

the control is a co+!aratively 4e.!ensive4 +ethod of creatin( connections, usin( at least two connections for the first control, and one +ore for each subsequent control"

Creatin( a -ront end Database A!!lication with Mini+al Code

/t*s !ossible to create a database a!!lication usin( a +ini+u+ of code by settin( a few !ro!erties at desi(n ti+e" /f you are usin( an O$% D& data source, the Microsoft Data $ink 7a+e ("5D$) +ust be created on your +achine" #ee 4Creatin( the 7orthwind O$% D& Data $ink4 for a ste! by ste! e.a+!le" To create a sim(le 'ront)end database a((lication 8" Draw an ADO Data Control on a for+" (The icon*s ToolTi! is 4ADODC"4) /f the control is not available in the Toolbo., !ress CT2$9T to dis!lay the Com(onents dialo( bo." /n theCom(onents dialo(, click Microso't ADO Data Control" :" On the Toolbo., click the ADO Data Control to select it" Then !ress -; to dis!lay the *ro(erties window" <" /n the *ro(erties window, click ConnectionStrin$ to dis!lay the ConnectionStrin$ dialo( bo." ;" /f you have created a Microsoft Data $ink file ("5D$), select +se O,! DB #ile and click Bro-se to find the file on the co+!uter" /f you use a D#7, click +se ODBC Data Source ame and select a D#7 fro+ the bo., or click e- to create one" /f you wish to use create a connection strin(, select +se ConnectionStrin$, and then click Build, and use the Data ,ink *ro(erties dialo( bo. to create a connection strin(" After creatin( the connection strin(, click O." The ConnectionStrin$ !ro!erty will be filled with a strin( like= 5. driver={SQL Server};server=bigsmile;uid=sa;pwd=pwd;database=pubs >" /n the *ro(erties window, set the RecordSource !ro!erty to a #6$ state+ent" -or e.a+!le, 7. SELECT * F !" Titles #$E E %ut&'r() = 7* 'ou should always include a ?3%2% clause when accessin( a table" -ailin( to do so will lock the entire table, which would be a +ajor hindrance to other users" @" Draw a Te/tBo/ control on the for+ to dis!lay the database infor+ation" A" /n the *ro(erties window, set the DataSource !ro!erty for Te.t8 to the na+e of the ADO Data control (ADODC8)" This binds the te.t bo. to the ADO Data control" 8B"/n the *ro(erties window, click Data#ield and a list of available fields will dro! down" Click the na+e of the field you want to dis!lay" 88"2e!eat ste!s >, C, and @ for each additional field you want to access"

8:"0ress -D to run the a!!lication" 'ou can use the four arrow buttons on the ADO Data control to +ove to the be(innin( of the data, to the end of the data, or fro+ record to record throu(h the data"

#ettin( the Connection#trin(, #ource, Data#ource, and Data-ield 0ro(ra++atically


The code below shows how to set these four !ro!erties !ro(ra++atically" 7ote that settin( the Data#ource !ro!erty requires the #et state+ent" +rivate Sub F'rm,L'ad-. #it& %)!)C/ .C'00e1ti'0Stri0g = 2driver={SQL Server};2 3 , 2server=bigsmile;uid=sa;pwd=pwd;database=pubs2 . e1'rdS'ur1e = 2Sele1t * Fr'm Titles #&ere %ut&'r() = 72 E0d #it& Set Te4t/.)ataS'ur1e = %)!)C/ Te4t/.)ataField = 2Title2 E0d Sub

ADO Data Control %vents


The ADO Data control features several events that you can !ro(ra+" The table below shows the events and when they occurE however the table is not +eant to be a co+!lete list all of the conditions when the events occur" -or co+!lete infor+ation, see the reference to!ic for the individual event" !0ent Occurs

?illMove

On 2ecordset"O!en, 2ecordset"Move7e.t, 2ecordset"Move, 2ecordset"Move$ast, 2ecordset"Move-irst, 2ecordset"Move0revious, 2ecordset"&ook+ark, 2ecordset"Add7ew, 2ecordset"Delete, 2ecordset"2equery, 2ecordset"2esync

MoveCo+!lete

After ?illMove

?illChan(e-ield

&efore the )alue !ro!erty chan(es

-ieldChan(eCo+!lete

After ?illChan(e-ield

?illChan(e2ecord

On 2ecordset"5!date, 2ecordset"Delete, 2ecordset"Cancel5!date,

2ecordset"5!date&atch, 2ecordset"Cancel&atch

2ecordChan(eCo+!lete

After ?illChan(e2ecord

?illChan(e2ecordset

On 2ecordset"2equery, 2ecordset"2esync, 2ecordset"Close, 2ecordset"O!en, 2ecordset"-ilter

2ecordsetChan(eCo+!lete

After ?illChan(e2ecordset

/nfoMessa(e

?hen the data !rovider returns a result

1. 2.

To develop a database application with Visual Basic Start Visual Basic, choosing a Standard Executable project. Add the Microsoft AD Data !ontrol ".# to $our tool palette% ' &ro' the (roject 'enu, choose !o'ponents.
'

Select the Microsoft AD

Data !ontrol ".# co'ponent fro' the list.

'

!lic)

* to add the control to the +oolbox palette.

,.

Add the AD Data !ontrol to the for', as follo-s% ' &ro' the Vie- 'enu, choose +oolbox.
' '

!lic) the Adodc icon in the +oolbox palette. Dra- a rectangle on the design for'.

..

!onfigure the AD
Property !o''and+$pe

Data !ontrol%
Value

2 / ad!'d+able

!onnectionString (ro0ider1SA 2EDB3DS41S52 An$-here 1# De'o !ursor2ocation !ursor+$pe 7ecordSource 2 / ad6seSer0er 2 / ad penD$na'ic E'plo$ees

8.

+he !onnectionString uses the S52 An$-here 2E DB (ro0ider 9SA 2EDB: to connect to the ;S52 An$-here 1# De'o; data source. +he cursor settings ta)e ad0antage of S52 An$-here ser0er/side cursors rather than using client/side cursors. ". Add t-o text boxes to the for', as follo-s% ' !lic) the +extBox icon in the +oolbox palette.
' '

Dra- a rectangle on the design for' just abo0e the Adodc1 control as sho-n in the diagra' belo-. Dra- a second rectangle on the design for' to the right of the first +extBox as sho-n in the diagra'.

<.

Bind the text boxes to the AD Data !ontrol% ' Set the DataSource propert$ for each to be Adodc1.
' '

Set the Data&ield propert$ for the left/hand text box to GivenName, -hich is the colu'n holding the e'plo$ee=s first na'e. Set the Data&ield propert$ for the right/hand text box to Surname, -hich is the colu'n holding the e'plo$ee=s last na'e.

>. ?.

Sa0e the project. 7un the sa'ple% ' !hoose 7un @ Start to run the application. +he application connects to the S52 An$-here sa'ple database and puts the na'e of the first e'plo$ee in the text boxes, as follo-s%

Aou can use the buttons on the AD Data !ontrol to scroll through the ro-s of the result set. Aou ha0e no- created a si'ple Visual Basic application that -or)s -ith AD and the S52 An$-here 2EDB pro0ider.
'

"ARD!ARE 4

SOFT!ARE RE#UIREMENTS

,-,TE. $EG'I$E.E#T
In order to install the software your system must the following specification . "ard/are Re)uire*ent&' !ro"essor
higher 9 (elorn processor :.< or Pentium III or

#AM

9 .0- .3 $). 3 H& or more

$D %p%"it& 9 0 S"%nner

9 ,hould be of good 7uality

!rinter
0

9 Inkjet 3@/ or color

S(ft/are Re)uire*ent& '

Oper%ting S&stem9 /indows 01 or higher version !%"'%ges


9 2isual 3asic F.D4 %racle

C(nc+usi(n

#ow 4as the user @reader has under gone through the listing )#& other accessories details of the project work 4so we feel that the user must have become well ac7uainted with the aim )#& feed back of this work. /e wish that the ac7uaintance of the user with this work revals a positive response )#& he@she finds this effort of ours in their good thoughts. %f course4 at the beginning 4project appeared very small4but when we actually started the work 4 we encounterd its depth. This project work coverd every aspect of the customer management. The e=perience of our guide helped us a lot in this regard. This project gives us complete satisfaction. Thanks a million for going through our work 4because your viewing )#& satisfaction is the reward for our work in developing this project to its present shape. Hope you rewind thisH. ThanksI

BIBLIOGRAPHY

Tit+e 8..astering visual basic F.D! :.2isual basic F in record time

Aut5(r 3P3 Publication by E.Petroutsos. 3P3 Publication by steve brown.

;. 2isual basic F devel! 3P3 Publication by oper?s handbook Petroutsos .

S-ar putea să vă placă și