Visual Basic


Posted on Updated on

DAO or ADO – What’s the Difference?

  • With the introduction of Visual Basic 6, a new data control has emerged – the ADO (ActiveX Data Object) data control.  Past versions of Visual Basic have used the DAO (Data Access Object) data control (also included with Visual Basic 6).  So, Visual Basic 6 users (and Visual Basic 5 users, too) may be asking – what’s the difference?
  • Both controls do the same thing – provide a tool for working with the Jet database engine to perform database management.  The controls just do it in different ways.  DAO is the most widespread approach to database management and, as such, has a very large installed base of applications.  ADO is an emerging technology, which will one day supplant the DAO control.  Be aware, as an emerging technology, ADO still has bugs!  As we work through this course, we will identify some of these bugs and figure out how to work around them.
  • Why Use DAO Instead of ADO?

You are modifying an existing application that uses DAO.

You are developing a small desktop application.

For now, the DAO control offers better database security features.

Microsoft Access uses DAO, so the market will be there for a while.

  • Why Use ADO Instead of DAO?

You are beginning a new project, with potential for Internet deployment.

ADO is easier to use than DAO.

ADO is a more powerful control, allowing access to more data sources.

If you don’t use the Jet engine, ADO is the only way to go.

ADO will eventually become the only data control, with DAO becoming obsolete.

 Posted by Vissicomp Technology Pvt Ltd

DataTypes in VB

Posted on Updated on

Data Type in Visual Basic

The following table shows the supported data types, including storage sizes and ranges.

Data type Storage size Range
Byte 1 byte 0 to 255
Boolean 2 bytes True or False
Integer 2 bytes -32,768 to 32,767
(long integer)
4 bytes -2,147,483,648 to 2,147,483,647
(single-precision floating-point)
4 bytes -3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values
(double-precision floating-point)
8 bytes -1.79769313486232E308 to
-4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values
(scaled integer)
8 bytes -922,337,203,685,477.5808 to 922,337,203,685,477.5807
Decimal 14 bytes +/-79,228,162,514,264,337,593,543,950,335 with no decimal point;
+/-7.9228162514264337593543950335 with 28 places to the right of the decimal; smallest non-zero number is
Date 8 bytes January 1, 100 to December 31, 9999
Object 4 bytes Any Object reference
10 bytes + string length 0 to approximately 2 billion
Length of string 1 to approximately 65,400
(with numbers)
16 bytes Any numeric value up to the range of a Double
(with characters)
22 bytes + string length Same range as for variable-length String
(using Type)
Number required by elements The range of each element is the same as the range of its data type.