Delphi 5 Certification Guide
Delphi 5 Certification Guide
Delphi 5 Certification Guide
1. Borland's Delphi C/S 5 Foundations Courseware Manual which you receive when you take a Delphi 5
C/S Foundations training class. This cannot be purchased separately as a self-study guide.
General Knowledge
Section 1: Delphi Interface and Configuration
a. With two or more components on a form, describe how to modify a common property at the
same time.
b. You have component A and component B on a form. Both components have an event-handler
in common and component B's event-handler has been assigned. How can you assign
component A's event-handler to component B's event-handler without writing any code?
c. There are three buttons on a panel. Describe two ways to select the buttons for alignment.
d. There are several non-visual components on a form. How can you see the names of these
components without using the Object Inspector?
e. After creating a project with two forms, Form A and Form B, you decide to change the main
form of the project. Since Form A was created first, it is the form that is displayed when the
application is run. How can you change the application so that Form B is the main form
a. On a form you have placed a panel. On the panel you have placed a button. Which object is
the owner of the button?
b. In the preceding question, what happens to the button if the panel is destroyed?
c. Why don't you have to create a name property for a component that you create?
d. A component is inherited from TControl. Explain how you can have the component respond to
an OnClick event?
e. After creating a project using the default setting, you decide to convert the application to a
MDI style application. What is the property that must be modified on the forms of this project?
f. You want to create on object that paints itself on a form. What class could you inherit from to
help you accomplish this task?
g. An application has an editbox and a button. How can you change the caption of the button to
the text in the editbox during run-time?
h. You have created a form that is very data intensive. You are displaying data from several
tables. This is going to cause your form to be very cluttered in the designer. How can a
DataModule help with this problem?
i. How do the complete hierarchies of TActiveForm and TActiveFormControl differ?
j. What are the properties and events of TActionsList?
k. What are the properties and events of TAction?
a. What component could you use to allow the user of your application to scroll a list of values?
b. What component could you use to display all the values in an array in a spreadsheet format?
c. An application calls for the checking of a registry setting while the application is running. You
do not want to burden the user with this action. What component could you use to check this
variable during the running of the application?
d. What advantage is it to use the dialog components in your application? By using the dialog
components in your application, what look and feel will your application have with other
Windows applications?
e. You could create a component by starting with a blank unit. What advantage does using the
component template give you?
f. What is a Delphi package?
g. Why would you want to create a package?
h. What component would you use to centralize state managment of menu items, buttons, and
other controls instead of setting the properties and states via the individual controls?
i. What properties of a control would you use to help keep relationships between the control and
its container?
Section 4: Pascal/Object Oriented Programming
a. We have placed a DBGrid on a form and connected it to a table in the database. How can you
view data in the DBGrid while in the designer?
b. An event-handler for the OnStateChange of the DataSource is defined. You want a dialog to
display when the user goes into insert mode, not edit mode. What property of a DataSet would
be useful in this application?
c. You have a client/server application that uses a TTable with its filter property set. Is the data
going to be filtered at the client or the server?
d. An application needs to create a master detail relationship between two TQueries. How can
the DataSource property of the TQuery component help with this application?
a. Describe the steps needed to modify a DataSets TField objects in the Object Inspector?
b. Describe how you would validate data with a TField object and an object that encapsulates
the validation rules for your application?
c. Explain how to add a calculated field to a DBGrid component.
d. What event-handler must you create to assign a calculated field its value?
e. The user is viewing a record in the DataSet. The user does a search that is not successful.
You need to make sure that you place the user back on the record they were viewing. How
can the DataSet's bookmark property help accomplish this task?
f. An application performs frequently repeated, database-related tasks on the server. This is
going to increase network traffic and also cause the application to be less efficient. How can
the use of the TStoredProc component help?
g. If you only need to view five columns of a table, why would you use a TQuery and not a
TTable?
h. Our application allows the user to modify data in a grid. The user makes several modifications
to different rows in the grid. The user decides to cancel the changes made. What problem will
the user encounter when the changes are canceled? How can the use of cached updates or
transaction processing help?
i. Compare and contrast TTable and TQuery.
a. An application shows the user in a list box with a list of aliases that can be connected to.
Which component is used to get the aliases shown to the user?
b. What are transaction isolation levels? What component do you use to manage these?
c. Compare and contrast connecting through the BDE, IBX, or ADO.
Section 9: SQL
a. You need to execute some SQL statements on a table in the database. The statements are
not going to return a result-set. Which method of a TQuery should you use?
b. You are going to execute the same SQL statements several times in our application. What
advantage is there in preparing the SQL?
a. After writing several applications, you notice there are functions that you commonly use in
each application. If a DLL was created to encapsulate the common functions, how does this
affect the application that uses these functions?
b. In the same scenario, how is maintenance of the common function affected?
c. What declaration is used to make a function or a procedure visible from a DLL?
d. What are the differences between a normal project’s main CPP file and DLL project’s main
CPP file?
e. Even though explicit loading of a DLL causes more code to be written, what advantage does it
have over implicit loading?
f. If you are working in an environment where disk space is at a premium, how can creating run-
time packages help?
g. What effect does creating only design-time packages have on the size of your executable?
h. What is contained in the package source file?
i. What compiler directives should be used and understood when deploying packages?
a. Are you familiar with the difference between TActiveForm and TActiveFormControl?
b. Can you describe how to create an ActiveX control?
c. Are you familiar with how to create an OLE automation server?
d. What are OLEVariants and how are they used?
e. What is a Type Library and how are they used?
Section 13: Exception Handling
a. You need to create a component for your application. From which Delphi class in the
hierarchy can you start inheriting to create your component?
b. When the user assigns a property for your component, how can you automatically take some
action?
c. How do you get a property to be written to the DFM file?
d. Where would you assign the default values for a component's properties?
a. How do you embed debugging information in your code so you can take advantage of Delphi's
debugger?
b. How does embedding debugging information affect the size of the executable?
c. In order to modify variables in the debugger, what option must first be selected?
d. Explain why you would want to use a breakpoint in your code.
e. Debugging client server applications can often require debugging across multiple machines.
How does Delphi allow this to be done? What are the limitations of this feature with respect to
operating systems?
a. Can you look at and filter out SQL passed between your application and the server?
b. Are you familiar with the BDE Administrator?
c. Are you familiar with creating an icon for your custom component?
d. Are you familiar with the Data Migration Expert?
e. Are you familiar with Team Source?
Sample Questions
Answer: ABC
2. What must be true to delete records from a result set using the TQuery Delete method?
A. The RequestLive property must be set to True.
B. The Active property of the Query must be True.
C. The UpdateMode must be set to umWhereKeyOnly.
D. The CanDelete method must return True for the record.
E. The Can Modify property of the dataset must be True.
Answer: ABE
Answer: ABDF
4. Which technique for filtering data provides optimum results when accessing data from a database
server?
A. Use a TQuery with a WHERE clause in the SQL.
B. Use a TTable and the SetRange method.
C. Use a TQuery and set the Filter and Filtered properties.
D. Use a TTable and set the Filter and Filtered properties.
Answer: AD
5. Which statement is true about deploying a Delphi Enterprise database application?
A. You may deploy the BDE royalty free.
B. The BDE must be deployed on the client PC.
C. A BDE alias must be configured on the client PC.
D. The SQL Links must be deployed on the client PC.
Answer: A
6. Which modifications can be required in order to package components written using a previous version
of Delphi?
A. Change the uses clause declaration to include the new Packages unit.
B. Change the uses declaration to "Include."
C. Uninstall the components from the Component Pallet.
D. The unit files must be recompiled into a .BPL file that will then be compatible with Delphi 5.
E. Remove files from the include clause which are in a package's requires clause.
Answer: D
7. Which steps should be used to prevent an application from being compiled with packages?
A. Remove all packages from the development PC.
B. Under Project|Options, click on the Packages tab and clear the "Runtime Packages" edit box.
C. Include the $DENYPACKAGEUNIT ON compiler directive in each unit of the project.
D. Under Project|Options, click on the Packages tab and uncheck the "Build with runtime
packages" checkbox.
Answer: BD
Answer: BC
9. How can a Type Library file from a C++ programmer be used within Delphi?
A. It allows the decompilation of the EXE or OCX.
B. It allows the IDE knowledge of the type of interfaces created by the C++ programmer.
C. It allows the Delphi program to be designed in a way that improves performance over the
design that must be used without a type library.
D. It allows the user to program in C++ within the Delphi IDE.
Answer: B
10. Which should you do when you are finished using an OLE object?
A. Call its Free Method
B. Call its Delete Method
C. Call its Release Method
D. Call its Destroy Method
E. Set its variant variable to UnAssigned
Answer: E
Answer: B
12. Which tasks can be performed using the SQL Explorer in Delphi Enterprise?
A. Run an SQL query.
B. Create Paradox tables.
C. Create TTable components in a Delphi project.
D. Add a TStoredProc component to the Object Repository.
E. Add an event-handler to an event in a TQuery component.
Answer: AB
13. What is the purpose of the Team Source?
A. allow multiple developers to work on the same project
B. reconcile changes to the same files in a project
C. replaces PVCS and ZLIB witht a new version control engine
D. to edit DCU, OBJ and EXE files
E. to create and edit Delphi Component Resources
Answer: BCE
Answer: BCD
General
This application definition is very general, but should be built using Client/Server techniques using local InterBase.
OLE Containership
The application should launch a modal form that allows the user to modify a word processing document. This document
must still be available for editing outside the application.
Components
Create a component that will allow the user to select a database to connect to. This component should list all the aliases in a
list box. When the user double-clicks on an item, the component should dynamically update the application's DataSets. Create
a package and install the component. Although, in practice, you would never need such a component, completing this exercise
illustrates some important issues.
Resources
Create an AboutBox for your application. This AboutBox must be shown modally and only use system resources when it is
viewed.
DLL
Create a DLL that will allow the user to retrieve a date. The DLL should use the TCalendar class and should return the date as
a string.
DataSets
Create a customer form that allows the user to view, edit, insert, and delete customers and their associated orders.
Place two speed buttons on the form. These buttons should let the user navigate through the list of orders for a customer.
Only activate the buttons if there are records to navigate (i.e. If you are at the top of the DataSet, the button to move to the
previous record should be inactive).
Place three buttons on the form, each showing a dollar amount. When a button is clicked, the list of customer's orders should
be less or equal to the amount of the button. For example, when the user selects a button that has $100 in the caption, no
orders over $100 should be shown for the customer.
When entering a new order, the application should not allow an order over $5,000 in value. To do this, create a rule object
that will validate the value of an order. This object should return True or False if it is a valid order. If the order is not valid,
the application should raise a custom exception preventing the posting of the order.
Create an additional field to be displayed with the orders for a customer. This field should not be stored in the table. The
caption for this field should be Discount. This field should display 10% of the order's value.
The form should have a page control. Create two pages on the control. Place all the objects created so far on the first page
(try using Windows cut and paste). The second page should list all the line items for an order.
Triggers
The customer table should have an ID column that will need to be populated with a unique value when a new customer is
inserted into the table. A stored procedure should be created to return a new value for this ID column.
Database Procedures
The customer form should display the total value of its orders. Create a stored procedure in the database that passes this value
to the application.
Borland UK Ltd Borland B.V. Borland Nordic Borland France Borland GmbH
8 Pavilions, Van Heuven Goedhartlaan 935 Gårdsvägen 7C/2 TR La Defense 8 Robert-Bosch-Strasse 11
Ruscombe Business Park, NL-1181 LD 169 70 Solna Tour Franklin 92042 63225
Twyford, Berkshire, Amstelveen Stockholm Paris La Defense Cedex Langen
RG10 9NN The Netherlands Sweden France Germany
Tel: 0118 924 1400 Tel: +31 20 503 51 00 Tel: +46 8 4703390 Tél: +33 1 55 23 55 00 Tel: +49 6103/979-0
Fax: 0118 924 1401 Fax: +31 20 503 51 70 Fax:+46 8 4705315 Fax: +33 1 55 23 55 74 Fax: +49 6103/979-290