Chapter 03 : Visual Basic .NET Fundamentals

Overview

This chapter and Chapter 4 will help Microsoft Access developers achieve the same degree of comfort with Microsoft Visual Basic .NET that they currently enjoy with classic Microsoft Visual Basic ”which practicing developers often call VBA and VB, respectively. In both these chapters, I focus on content that has special relevance to Access database developers and that can measurably improve the flexibility of solutions they create. All the database samples in this chapter feature Access databases, and these samples are available either as folders or as code listings from which you can readily create folders.

Access database developers use various types of data to create solutions. If you don t use the right data types, you can force the premature reengineering ”or at the very least slow down the operation ”of an otherwise well- designed system. This chapter starts by reviewing Visual Basic .NET data types and contrasting them with Access table data types. In particular, you will learn how to map traditional Access data types to those in Visual Basic .NET. The discussion of data types has a couple of goals: introducing data types as objects and contrasting values types with reference types. Understanding these two topics will enable you to use Visual Basic .NET data types more effectively when crafting Access database solutions.

This chapter will also expose you to traditional Visual Basic .NET programming topics, including Sub and Function procedures, branching and looping, and arrays. The code samples in these sections have two main objectives: to show you how similar Visual Basic .NET is to the classic Visual Basic that you already know and love, and to show you how to take advantage of new functionality as well as drop old programming habits that don t carry over to Visual Basic .NET. Furthermore, I will introduce you to the COM Interop feature of Visual Basic .NET. Access developers migrating to Visual Basic .NET are likely to find this feature particularly important because it enables them to use Microsoft ActiveX Data Objects (ADO) classes in Visual Basic .NET solutions.

The chapter closes with a review of programming techniques for implementing properties and methods in custom classes. All the samples in this section feature the familiar Northwind database. The focus on objects in Visual Basic .NET makes programming objects more natural than ever before (for example, data types are objects). Regardless of whether you regularly program custom classes with classic Visual Basic, this closing section offers new functionality that you will need to know. The treatment of classes in this chapter lays a foundation for some more advanced topics covered in Chapter 4, such as event processing and class inheritance.

 


Programming Microsoft Visual Basic. NET for Microsoft Access Databases
Programming Microsoft Visual Basic .NET for Microsoft Access Databases (Pro Developer)
ISBN: 0735618194
EAN: 2147483647
Year: 2006
Pages: 111
Authors: Rick Dobson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net