Access 2002 Objects

team lib

There are several sets of objects that you might come across in Access, and they can be categorized quite simply:

  • General Access Objects

  • Data Access Objects

  • ActiveX Data Objects

In this chapter we're only going to concern ourselves with the first of these - the General Access Objects. The Data Access Objects will be covered in the next chapter, and ActiveX Data Objects are discussed in the appendices.

But before we do, we will look briefly at the new features added to the AccessObject model in the latest version of Access.

New Objects in Access 2002

These tables show what is new, so that you can see the technical trends or direction that Microsoft are applying to Access.

Access 2002 has only modestly added to the list of objects, all of which allow the programmer greater flexibility when dealing with Access - the new objects are listed below:

Access Object

Refers to

Used in Chapter

AllFunctions

A collection that holds an AccessObject object for each function in CurrentCode or CurrentData object

Not Applicable

LanguageSettings

An object that holds the details of the language settings

Not Applicable

Printers (Printer)

A Printer collection that holds a Printer object for each available printer on the system

Chapter 10

Items marked Not Applicable are beyond the scope of this book, and are therefore not covered.

In summary the new features of immediate interest to us include ( please see the Help for full listing of new features):

New Objects

Object

Particulars

AllFunctions collection

Provides the ability to refer to a function object in the CurrentData or CurrentCode collections - in a similar vein to the AllTables , AllQueries , and AllViews collections.

Printers collection & Printer object

Enables us to programmatically control the printers of the system.

New Object Properties & Methods

Object(s)

Method/Property

Particulars

AccessObject

DateCreated property

Returns date & time when object design was created (read-only)

 

DateModified property

Returns date & time when object design was last modified (read-only)

Application

BrokenReference property

Indicates if the current database has broken references to type libraries or databases

 

FileDialog property

Returns a file dialog box

 

Printer property

Sets or returns an object that represents an available system printer

 

Printers property

Returns a collection that represents available printers

 

Versions property

Returns version number of current copy of Microsoft Access (read-only)

 

ConvertAccessProject method

Converts the version of a Microsoft Access file using the constant acFileFormat : acFileFormat can be Access XP , 2000 , 97 , 95 & 2

 

ExportXML method

Exports in XML file format: data, schema & presentation details

 

ImportXML method

Imports from XML file: data, schema & presentation details

CodeData

AllFunctions property

Returns a collection that represents the functions ( user -defined) in a SQL Server database

CurrentData

AllFunctions property

Returns a collection that represents the functions (user-defined) in a SQL Server database

CurrentProject

FileFormat property

Returns the Microsoft Access version or file format of a given project (read-only)

 

RemovePersonalInformation property

Returns or sets a boolean that indicates if personal (user) information is stored in the active data access page or current project

Form (there are approximately 48 new properties & methods: for brevity a selection is shown - see Help for a complete list)

DataChanged property

Returns or sets an event procedure, user-defined function or macro that is called on the DataChange event

 

OnConnect property

Returns or sets an event procedure, user-defined function or macro that is called on the OnConnect event

 

OnDisconnect property

Returns or sets an event procedure, user-defined function or macro that is called on the OnDisconnect event

 

OnUndo property

Returns or sets an event procedure, user-defined function or macro that is called on the Undo event

ListBox & ComboBox

AddItem method

Adds an item to the list of items in either a listbox or combo box control

 

RemoveItem method

Removes an item from the list of items in either a listbox or combo box control

 
team lib


Beginning Access 2002 VBA
Beginning Access 2002 VBA (Programmer to Programmer)
ISBN: 0764544020
EAN: 2147483647
Year: 2003
Pages: 256

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