|
Here is a question that you can use to assess the skills of
a junior level VB developer. A developer with 6 months Visual
Basic 6 experience should understand this question and be
able to explain the correct answer. This question will test
the applicant's basic understanding of ADO (Active Data objects),
which is the technology Microsoft recommends for accessing
data sources. Anyone who has built a 'production' visual basic
application should be able to answer this question.
When using ADO in a Visual
Basic 6.0 Application, what are the 3 main objects for ADO?
Describe each object and it's purpose.
The three main
objects are the Command, Connection, Recordset objects.
The candidate should be able to explain the following points:
- The Connection
object is the top object in the hierarchy. The other objects
use this object to connect to the database. A connection
object will connect to 1 database.
- The Command
object is used to execute stored procedures and SQL.
- The Recordset
object is used to store records returned from a database.
It can be thought of as a container for the resultset returned
from a database query.
If the candidate
talks about DAO (data access objects) or RDO remote data objects
these are older technologies; it could mean the candidate
is not as experienced with ADO.
The Parameter,
Field, Error, and Property objects are 'minor' objects used
in ADO, if a candidate gives these answers it may show that
he or she has only read about but not used the technology.
While these 'minor" objects are technically objects used in
ADO, they are not as common as the command, connection and
Recordset objects.
A candidate may
state that a 'clone' is one of the main objects. A clone is
a method, not an object. This answer would imply that the
candidate is not experienced in using ADO but might have some
minimal exposure. Other incorrect answers are begintrans,
committrans, rollbacktrans and execute which are also methods
not objects.
Follow- up questions:
How
can you tell if a Recordset Object contains no records?
Check to see if
the .bof property and .eof property are both true. The candidate
may offer the count property, or recordcount property, these
are both incorrect.
How do you specify which database
you are connecting to?
The connection
object is configured with a connectionstring, which provides
information to the connection object such as the database
it's going to connect to login, password, etc.
What
are some of the methods used to move through a Recordset object?
| Method |
Result |
| Movefirst |
Moves
to the first record in a recordset |
| Movelast |
Moves
to the last record in a recordset |
| MoveNExt |
Moves
to the next record in a recordset |
| Move |
Moves
n records in a Recordset |
| MovePrevious |
Moves
to the previous record in a Recordset |
| Find |
Searches
through a Recordset |
| Seek
method |
Searched
through a Recordset using the underlying indices. |
About
the author
Mark Horninger, A+, MCSE+I, MCSE, MCSD, MCDBA, is President
and founder of Haverford Consultants Inc. (http://www.haverford-consultants.com),
located in the suburbs of Philadelphia, PA. He develops custom
applications and system engineering solutions, specializing
primarily in Microsoft operating systems and Microsoft BackOffice
products. He has over 12 years of computer consulting experience
and has passed 31 Microsoft Certification Exams. During his
career Mark has worked on many extensive and diverse projects
including database development, client server and web-based
application development, training, embedded systems development
and Windows NT and 2000 project rollout planning and implementations.
Mark is a contributing author to the books: MCSE Windows
2000 Professional Study Guide, Designing SQL Server
2000 Databases for .NET Enterprise Servers, VB .NET
Developers Guide and Configuring and Troubleshooting
Windows XP Professional.
Mark lives with his wife Debbie and three children in Havertown,
Pa. and can be reached at mark@haverford-consultants.com
or markh@op.net.
|