Tuesday, May 20, 2008

What operator is used to pass a callback procedure to a DLL?

The AddressOf operator is used to pass a pointer to the Window API. The pointer
directs the API to the address of the callback procedure.

What are the two steps to implementing a Windows API?

Declare the DLL function.
Call the DLL function.

What actions are performed in the following code?

Dim xl As Object
'Do not specify a class type
Set xl = GetObject("C:\MyFiles\Earnings.xls")
When the code is executed, the application associated with the specified
extension starts, and the object in the specified file is activated without being
displayed.

What benefits does the components type library provide?

Viewing the type library provides you with the proper syntax for the classes,
interfaces, methods, properties, and events of the COM object.

What are the two most common additional options used with Regsvr32? When are these options used?

The /u option is used to unregister a COM server.
The /s option is used to register a server without displaying subsequent dialog
boxes.

If you are using a component that does not have an installation program, which utility will you use to register the component yourself?

Regsvr32 (Regsvr32.exe)

Sunday, May 18, 2008

What are two ways to update data in an ADO Data control's recordset?

The ADO Data control can automatically modify and update records without having to add any code. This is done when you modify a field or fields, then click
on one of the navigational buttons on the ADO Data control. You can also use
the Update method of the Recordset object to modify the data instead of using
the arrows on the ADO Data control.

What two properties do you set for an ADO Data control to connect to a database and source of data within the database?

You can create a connection to a data source by setting the ConnectionString
property of the ADO Data control. Then, you can set the RecordSource property
to a table (or SQL statement) from which to retrieve records.

What operator do you use in SQL to find values based on a pattern (or partial expression?

You can use the LIKE operator to find values in a field that match the pattern
you specify.

What is Structured Query Language used for?

Structured Query Language (SQL) is a language used for querying, updating,
and managing relational databases. SQL can be used to retrieve, sort, and filter
specific data from the database. In addition, you can add, change, and delete
data in a database using SQL statements.

What are the three components of OLE DB?

Conceptually, OLE DB has three types of components: data consumers, service
components, and data providers. Data consumers are applications that use the
data exposed by data providers. Service components are elements that process
and transport data and extend the functionality of data providers. Data
providers are applications, such as Microsoft SQL Server or Exchange.

What is the difference between a primary key and a foreign key?

A primary key is a field, or combination of fields, whose value is unique for each
row, or record, in the table. For example, the Employee ID field is the primary
key for the Employees table. No two employees can have the same ID.

A foreign key "points to" a primary key field in a related table. For example, in
the Northwind database, the Orders table contains a Customer ID field. Each
Customer ID in the Orders table identifies which customer made the order.

Why should you use ADO as a data access interface?

ActiveX Data Objects (ADO) is Microsoft's newest data access technology and is
an interface to OLE DB. OLE DB is Microsoft's strategic low-level interface to all
types of data. This allows you to retrieve database and other data.

What are the three data access interfaces available in Visual Basic?

In Visual Basic, three data access interfaces are available to you: ActiveX Data
Objects (ADO), Remote Data Objects (RDO), and Data Access Objects (DAO).

Friday, May 16, 2008

If you were to create an object model based on a bicycle, how would you implement it?

You could create a Bicycle class that contains FrontWheel and BackWheel
properties (implemented as objects). The FrontWheel and BackWheel objects
could contain a Spokes collection.

What are three ways to create an object to access an external component?

Dim ObjectVariable As New Class
Set ObjectVariable = New Class
Set ObjectVariable = CreateObject("Component.Class")

Why should you use specific object variables rather than generic object variables whenever possible?

In most cases, you know at design time the type of object you want to create
and use in your application. It is much more efficient, in these cases, to use
specific object variables to point to the objects you create. A specific object
variable refers to a particular object type and can only hold pointers to that
type. If you try to store a different object type in that variable, an error will
result.

What is the purpose of a class module in Visual Basic?

Class modules (.cls files) are the foundation of object-oriented programming in
Visual Basic. They are analogous to a blueprint for a house. Just as a house is
built from a blueprint, new objects are created from class modules. These new
objects include your own customized properties and methods.

What is COM?

The Component Object Model (COM) allows you to create software components
that can be reused by other Visual Basic applications. These software
components provide "services" to client applications. In other words, your
application (using Microsoft Word objects) acts as a client that requests
services from a component (Microsoft Word). Any custom components that you
create in Visual Basic can be used by applications written in other languages
that support the COM standard, such as Visual C++.

When should you consider using a centralized error handler instead of normal, procedure-based error

If your application performs the same task in a number of different procedures,
a centralized function that includes specific error-handling code can be more
efficient and easier to maintain.

What is the last step in implementing an inline error handler?

Manually clear the Err object.

Why should you create your own error handlers instead of using the default Visual Basic handler?

The Visual Basic default error handler does not give the user an opportunity to
correct the error. In addition, the default handler does not run code associated
with cleaning up the application, such as allowing the user to save changes.
Only a custom error handler provides this capability.

If you do not implement an error handler and a run-time error occurs, what does Visual Basic do?

Provides the error number and description to the user and then terminates the
application.

Thursday, May 15, 2008

What is a watch expression and when do you use it?

A watch expression is an expression whose value you want to "watch" or
monitor as the code runs. You define them and Visual Basic automatically
monitors them. You use a watch expression when you can't trace a problem to
a specific statement.

Why do you use the Locals window?

You use the Locals window to monitor how your variables change as the code
runs.

What tasks can you perform using the Immediate window?

The Immediate window lets you evaluate expressions, change the value of
variables, and execute different procedures. You use the Immediate window
when in break mode and manually interact with the application to test for logic
errors.

What is the difference between the Step Into, Step Over and Step Out debugging tools?

What is the difference between the Step Into, Step Over and Step Out debugging tools?
Step Into runs the code one statement at a time, advances to the next
statement and enters break mode.
Step Over executes a called procedure while Step Into enters break mode after
calling the procedure.
Step Out moves past the remainder of the code in the current procedure.

Identify and explain the two methods of the Debug object.

The Debug object's Print method lets you send output from the program to the
Immediate window without entering break mode. It lets you track variable
values at full execution speed and creates a history list of the values in the
Immediate window.
The Debug object's Assert method forces a run-time break when an expression
evaluates to False. You only use this method in the Design environment.

What is the purpose of break mode in the debugging process?

Break mode stops the application and lets you check your code one statement
at a time. In addition, usiong the various Visual Basic debugging tools, you can
also wlak through your code in large blocks, such as by procedure or run to the
point where you have placed the insertion point. This can be useful when you
wish to "step over" many lines of code that you already know run correctly.

What are the three types of errors that can occur in a Visual Basic program and when does each occur ?

The types of errors include syntax, run-time, and logic errors.
Syntax errors occur when code in a statement is constructed incorrectly.
Run-time errors occur while the application is running and a statement attempts
an operation that is impossible to carry out.
Logic errors occur when code does not perform as you intended.

There are two textboxes on a form, and the user types the letter "a" into one of the textboxes. If the form's KeyPreview property is set to True, will

TextBox control's KeyPress event fire?



Yes, the KeyPreview property value will cause the form's KeyPress event to fire
first, and the TextBox control's KeyPress event will fire next. By default, the
form's KeyPreview property is False, causing the TextBox's KeyPress event to
fire first. Using the form's KeyPreview property, you can implement form-level validation.
This is particularly useful if you need to monitor user input regardless of which
control on the form has focus.

What is the difference between the Text and C lipText properties of the Masked-Edit C ontrol?

The Text property returns the data that the user has typed, along with the
mask. For example, if the Mask property is set for a stanadrd US phone number,
the Text property would return:
(111) 555-1234
The ClipText property returns only the data the user has typed. Using the same
example, the ClipText would return:
1115551234

Why should you use the Validate event to validate data rather than using the LostFocus event?

It is possible to use the LostFocus event procedure to validate the data in a
field, however this validation technique can result in an infinite loop where one
or more controls are using the SetFocus method in the LostFocus event. The
Validate event eliminates the problem and makes it easier to manage field-level
validation.

What are the two main types of validation?

Form-level validation is when you perform data validation after all fields on a
form have been completely filled in by a user. For example, a customer entry
form could require a user to fill in a name, an address, a phone number, a city, a
state, and a zip code. After the user fills in these fields and clicks an OK button,
validation takes place to verify the data in each field.
Field-level validation is when each field is validated as it is filled in—in other
words, fields are validated one at a time. For example, a user could type in a
value for a zip code field on a customer entry form, and validation of the zip
code field would occur either as the user types in the value or before the user
moves to another field on the form. In Visual Basic, you can use the Change
event for a TextBox control to verify that the zip code value is numeric.

What is a control array? When do you need a control array?

A control array is a group of controls that share the same name, type, and
event procedures. But each control has its own properties.
You use control arrays to save system resources and to add controls at run
time.

Why would you set control properties at design time? Why would you set them at run time?

You set properties at design time when you want to set defaults for the
application. You set properties at run time when you want to control actions as
the application runs.

What is the difference between standard controls and custom controls, and where do you get them?

Standard controls are included in Visual Basic and are automatically available in
the toolbox. Custom controls are additional controls that can be added to the
toolbox if you want to use them in a project. Some come with Visual Basic.
Additional controls come in the Professional and Enterprise editions of Visual
Basic. Custom controls are also available from third-party developers.

What causes form events to fire?

A user action such as a mouse click or a key press fires a form event. The
system can also cause form events to fire, such as Windows shutting down

When would you have to set a startup form?

When the application has more than one form, you have to designate which will
be the first one the user sees. By default, Visual Basic will use the first form in a
project as the defaulkt startup form. As your applications become more
complex, you will need to add additional forms. You may find that a form added
later in the project should be used as the intial form.

Your boss told you to follow the "look" of Microsoft Word in designing the user interface of your new insurance form.

What specific elements will you look at?
Why did he want you to do this?


Look at the layout and colors. This includes: where various buttons, such as OK,
are located; icons on toolbars; menu commands and their access keys; the
order of the menus in Word (File is first, Edit is next, and so on.) The people in our company use Microsoft Word regularly, and they will more
easily learn a new application that has an interface that looks familiar. Reducing
their learning curve saves training time and expense

What are some of the commands used in Visual SourceSafe to reuse files and how are they used?

Sharing: To share a file, you create a shared link between two projects.
Branching: Branching a file breaks the shared link, while retaining a copy of the
file.
Merging: The process of combining differences in two or more changed copies of
a file into a new version of the file.

What are three ways to install Visual SourceSafe?

Both the Visual SourceSafe Explorer and the Visual SourceSafe Database can be
installed on the user's machine.
The Visual SourceSafe Explorer and the Visual SourceSafe Database can both be
installed on the server.
The Visual SourceSafe Explorer will be installed on the user's machine and the
Visual SourceSafe Database will be installed on a server.

When is a two-tier application most effective?

two-tier applications work well in departmental-scale applications with modest
numbers of users (under 100); a single database; and secure, fast networking.

What is an example of a single-tier application?

An example of a single-tier application is Microsoft Excel, where the user
interface and business rules are combined in the application. The business rules
include calculating totals, spell check, and other mathematical functions. In
addition, the routines that access and save the Excel application files (.xls) are
part of the same application layer as the user interface and business rules.

Which MSF Model directly focuses on software development?

The Solution Design Model provides a step-by-step strategy for designing
business-oriented solutions driven by a specific business need. This model ties
together the Application, Team, and Process Models, and makes it possible for
the information system staff to focus resources where they can produce the
most value. Because software development is a creative and complex process,
you can apply MSF's Solution Design Model to software development.

What is the Microsoft Solutions Framework?

Microsoft Solutions Framework (MSF) is a suite of models, principles, and guides
for building and deploying software. MSF is a collection of best practices used by
the Microsoft product groups and Microsoft Consulting Services.

What are the three design phases of the solution design model? What tasks are accomplished in these phases ?

Conceptual involves business sponsors, users, managers, and constituencies.
The goal of conceptual design is to understand what the users do and to identify
business needs. Much of conceptual design is an analysis activity that leads to
determining which processes and activities will go into the new system, how the
needs of those processes and activities will be met, and what the user's
experience will be of those activities.
Logical design activities are integrated directly with the resulting scenarios
from conceptual design, and provide the basis for Physical design. Logical
design describes the organization of the elements that make up the solution
and how they interact. You assemble the elements for optimum efficiency,
performance, and reuse.
Physical design describes a solution in a way that allows developers to construct the solution. Physical design communicates the necessary details of
the solution, including organization, structure, technology, and relationships
between elements that you will use to create the solution.

What are the models implemented in MSF? What are their purposes?

Team Model—defines a team of peers working in interdependent and
cooperating roles.
Process Model—helps your team establish guidelines for planning and
controlling results-oriented projects based on project scope, the resources
available, and the schedule.
Application Model—helps your team design distributed applications that take
optimum advantage of component reuse.
Enterprise Architecture Model—supports decisions relating to the information,
applications, and technology needed to support a business. It is the key to
successful long-term use of new technologies.
Solutions Design Model—shows how applications must be designed from a user
and business perspective (as opposed to the ideal streamlined development
proposed in the Application Model).
Infrastructure Model—establishes MSF principles for managing the people,
processes, and technology that support networks in a large enterprise.
Total Cost of Ownership Model—supports the process of assessing, improving,
and managing information technology costs and maximizing value.

What are the benefits of implementing MSF?

MSF helps organizations merge business and technology objectives, reduce the
life cycle costs of using new technology, and successfully deploy Microsoft
technologies to streamline business processes. MSF exposes critical risks,
important planning assumptions, and key interdependencies that are required
to successfully plan, build, and manage a technology infrastructure or a
business solution.

MFS helps to speed up development cycles, lower the cost of owning
technology, improve execution of planned events, improve reaction to
unplanned events, create scalable, reliable technology solutions, and improve
core information technology competencies.

Your Title