- Shopping Bag ( 0 items )
-
All (9) from $3.00
-
Used (9) from $3.00
Ships from: Seattle, WA
Usually ships in 1-2 business days
Ships from: Richmond, TX
Usually ships in 1-2 business days
Ships from: Chatham, NJ
Usually ships in 1-2 business days
Ships from: Chatham, NJ
Usually ships in 1-2 business days
Ships from: West Orange, NJ
Usually ships in 1-2 business days
Ships from: Chatham, NJ
Usually ships in 1-2 business days
Each iteration of Windows has meant a corresponding improvement in the techniques used for transferring data among its applications. Today's leading technique is called Automation. It allows you to work directly with objects in an application's interface using their object models. But if you want to write code in a programming language, such as Visual Basic, in order to work with the apps that support Automation, you must understand the inner workings of an application's object model—or in the case of Microsoft's Access, its two object models.
Microsoft Access is the bestselling stand-alone relational database program for Windows offering both power and ease of use. And in many respects, Microsoft has made Automation the centerpiece of its vision for application development. DAO Object Model: The Definitive Reference will guide you through the Access object models, allowing you, with the support of Automation, to reference the application components you want to manipulate. An understanding of the object models is essential for developers who work with data in Access tables, or who want to manipulate components of the Access interface from other Office apps. The Data Access Objects (DAO) model is used to write and read data in Access tables. The Access object model is used to manipulate forms, reports, queries, macros, and other components of the Access interface, including most of the commands by means of the DoCmd object.
This book will include an introduction and a brief description of the differences between VBA (used in most Office applications) and VBScript (used in Outlook). This chapter will also cover Office utilities and add-ons helpful in writing and debugging code, such as the Object Browser, the Integrated Development Environment (IDE) for VBA and the Interactive Debugger for VBScript. The book will then be divided into two parts; one covering the Access Object Model and the other, the Data Access Objects. Each section will have a description of what the object represents; listings of properties, events, and methods; and one or more code samples illustrating its use in VBA and/or VBScript code. Each property, event, or method section will have an explanation of the language element, and many will have code samples (either VBA or VBScript) as well.
This book will detail, to an advanced user or keen intermediate user, the Access object models and how they are used. It will be the reference guide VB developers reach for when working with data in Access tables, or for manipulating components of the Access interface from other Office applications.
Preface
1. Introduction
Early and Late Binding
The Object Models for Working with Access
The Visual Basic Dialects
2. DBEngine Object
DBEngine Properties
DBEngine Methods
3. Errors Collection and Error Object
Errors Collection Properties
Errors Collection Methods
Error Object Properties
4. Workspaces Collection and Workspace Object
Workspaces Collection Properties
Workspaces Collection Methods
Workspace Object Properties
Workspace Object Methods
5. Databases Collection and Database Object
Databases Collection Properties
Databases Collection Methods
Database Object Properties
Database Object Methods
6. Containers Collection and Container Object
Containers Collection Properties
Containers Collection Methods
Container Object Properties
7. QueryDefs Collection and QueryDef Object
QueryDefs Collection Properties
QueryDefs Collection Methods
QueryDef Object Properties
QueryDef Object Methods
8. Recordsets Collection and Recordset Object
Recordsets Collection Properties
Recordsets Collection Methods
Recordset Object Properties
Recordset Object Methods
9. Relations Collection and Relation Object
Relations Collection Properties
Relations Collection Methods
Relation Object Properties
Relation Object Methods
10. TableDefs Collection and TableDef Object
TableDefs Collection Properties
TableDefs Collection Methods
TableDef Object Properties
TableDef Object Methods
11. Groups Collection and Group Object
Groups Collection Properties
Groups Collection Methods
Group Object Properties
Group Object Methods
12. Users Collection and User Object
Users Collection Properties
Users Collection Methods
User Object Properties
User Object Methods
13. Fields Collection and Field Object
Fields Collection Properties
Fields Collection Methods
Field Object Properties
Field Object Methods
14. Parameters Collection and Parameter Object
Parameters Collection Properties
Parameters Collection Methods
Parameter Object Properties
15. Indexes Collection and Index Object
Indexes Collection Properties
Indexes Collection Methods
Index Object Properties
Index Object Methods
16. Properties Collection and Property Object
Properties Collection Properties
Properties Collection Methods
Property Object Properties
A. Object Model Browser
B. Object Model Browser Reference
Index INDEX:
A[ Top ]
AbsolutePosition property, 178
Access
to the Container object, 131
to the Database object, 80
to the DBEngine object, 25
to the Error object, 43
to the Field object, 294-295
to the Group object, 273
to the Index object, 330
object models for working with, 6-11
to the Parameter object, 321
to the Property object, 342-343
to the QueryDef object, 143
to the Recordset object, 174
to the Relation object, 230
to the TableDef object, 243
to the User object, 283
to the Workspaces collection and Workspace object, 51
Access 97
converting databases to Access 2000, 11
data source type, 69
Help errors in, 31
Access 2000
Help errors in, 31, 35
object model, 7, 128
Access Application object, SetOption method in, 40-41
Access code, displaying DBEngine properties, 19-20
Access custom database properties vs. Word, 98-101
Access databases, using OpenDatabase method for, 37
Access object model, 6
Access Screen object, 1
Access tables, creating, 240
Access VBA, creating databases from, 63
Access VBA code, 14-15
for GetRows method, 214
for OpenRecordset method, 116-117, 166
ActiveX Data Objects (ADO) object model, 9-11
AddNew method
Recordset object, 202-203
VBA code for, 202-203
ADO (see ActiveX Data Objects object model)
AllForms collection, 128
AllowZeroLength property
Field object, 298
read/write characteristics of, 298
AllPermissions property
Container object, 133-134
VBA code for, 134
AllPermissions return values
for Container objects, 133-134
for Document objects, 134
AllReports collection, 128
Append method
Fields collection, 296-297
Groups collection, 274-277
Indexes collection, 331-332
Properties collection, 344
QueryDefs collection, 145-146
Relations collection, 232
TableDefs collection, 244-245
Users collection, 284-285
VBA code for, 53-54, 145-146, 232, 245, 275, 277, 284-285, 296-297, 331-332, 344
Workspaces collection, 53-54
AppendChunk method
Field object, 316-317
VBA code for, 316-317
Application versions, 29-30
Arguments, assigning values to, 161, 340
Attributes intrinsic constants for Field objects, 299
Attributes property
Field object, 299-300
read/write characteristics of, 299
Relation object, 233-234
TableDef object, 247-248
VBA code for, 248, 300
Auto list members, 5
Automation code, 1
B[ Top ]
Batch update, ODBCDirect workspaces, 193
BatchCollisionCount property, Recordset object, 179
BatchCollisions property, Recordset object, 179
BatchSize property, Recordset object, 179
Beginning of file (see BOF property)
BeginTrans method
DBEngine object, 30
VBA code for, 58-59
Workspace object, 58-59
BOF property
Move methods with, 180
Recordset object, 180-181, 216
VBA code for, 180-181
Bookmark property
Recordset object, 178, 181-182
VBA code for, 181-182
Bookmarkable property, Recordset object, 182
C[ Top ]
CacheSize property
QueryDef object, 148-149
Recordset object, 182
CacheStart property, Recordset object, 183
Cancel method
QueryDef object, 159
Recordset object, 203
CancelUpdate method
Recordset object, 184, 203-204
Type intrinsic constants for, 203
VBA code for, 204
Cascading deletes, 207
Clone method, Recordset object, 204-205
Close method
Database object, 95-96
Outlook VBS code for, 96
QueryDef object, 159
Recordset object, 205
VBA code for, 95
Workspace object, 60
Clustered property, Index object, 333
cmdCopyQueryDef_Click event, 206
Code examples (see Access VBA code; Excel VBA code; Outlook VBS code; VBA code; VBS code; Word VBA code)
Coding, assistance in, 5
CollatingOrder property
Database object, 82-84
dstlocale named constants to set, 31-32
Field object, 300-302
read/write characteristics of, 301
VBA code for, 83-84, 301-302
VBS code for, 84
CollatingOrder property intrinsic constants, 300-301
CollatingOrder values, 83
Collection methods
Containers, 133
Databases, 82
Errors, 45
Fields, 296-298
Groups, 274-278
Indexes, 331-333
Parameters, 320, 323
Properties, 344-345
QueryDefs, 145-148
Recordsets, 175-176
Relations, 232-233
TableDefs, 244-247
Users, 284-286
Workspaces, 53-54
Collection numbering, 44
Collection properties
Databases, 80-82
Errors, 44
Fields, 295-296
Groups, 273-274
Indexes, 330-331
Parameters, 320, 322
Properties, 343
QueryDefs, 143-144
Recordsets, 175
Relations, 230-232
Users, 283-284
Workspaces, 51-53
Collections, persistent, 82
CommitTrans method
DBEngine object, 30
VBA code for, 58-59
Workspace object, 60
CompactDatabase method
DBEngine object, 31-35
dstlocale named constants for, 31-32
options named constants for, 32-33
VBA code for, 33-35
Compile errors, after converting Access 97 database to Access 2000, 11
ConflictTable property
TableDef object, 248-249
VBA code for, 248-249
Connect intrinsic constants for CreateDatabase method, 61-62
Connect property
Database object, 84-85
databasetype argument settings, 85, 149-150
QueryDef object, 149-150
TableDef object, 249-251
VBA code for, 150, 250-251
Connect property arguments, 249
Connection objects, opening on ODBC data source, 68
Connection property
Database object, 85-86
Recordset object, 183
constants (see Connect intrinsic constants; Intrinsic constants; Lockedits intrinsic constants; Named constants; Permissions property intrinsic constants; RecordStatus intrinsic constants)
Container object properties, 130-131, 133-139
AllPermissions, 133-134
Inherit, 134-135
Name, 135-136
Owner, 136
Permissions, 136-138
UserName, 138-139
Container objects
access to, 131
AllPermissions return values for, 133-134
in Database Containers collection, 127-128
Documents collections in, 128
Outlook VBS code for, 129-130
Permissions property intrinsic constants for, 137
VBA code for, 127, 129
Containers collection and Container object, 126-139
Containers collection methods, 133
Containers collections
in the DAO object model, 126
members of, 130
Containers object properties, 131-132
Count, 131-132
Item, 132
Control Panel, 356
CopyQueryDef method, Recordset object, 206-207
Count property
Containers object, 131-132
Databases collection, 80-81
Errors collection, 44
Fields collection, 295
Groups collection, 273
Indexes collection, 330
Parameters collection, 322
Properties collection, 343
QueryDefs collection, 143-144
Recordsets collection, 175
Relations collection, 230-231
TableDefs object, 243
Users collection, 283
VBA code for, 51-52, 81, 131-132, 231, 283, 295
Workspaces collection, 51-52
Create Enum Select Code option, 361
Create Model Wizard dialog, 355-356
CreateDatabase method
Connect intrinsic constants for, 61-62
DBEngine object, 35, 360
Options intrinsic constants for, 62
Outlook VBS code for, 63-64
VBA code for, 62-63
Workspace object, 60-64
CreateField method
Index object, 339
Relation object, 237-238
TableDef object, 262-263
Type intrinsic constants for, 262-263
VBA code for, 237-238
CreateGroup method
User object, 288-290
VBA code for, 65-66, 288-290
Workspace object, 64-66
CreateIndex method, 247
TableDef object, 263-265
VBA code for, 264-265
CreateObject function, 12, 21, 359
CreateProperty method
Database object, 97-101
Field object, 317-318
Index object, 340
QueryDef object, 159-161
TableDef object, 265-267
Type intrinsic constants for, 97-98, 160, 266-267
VBA code for, 101, 161, 267
CreateQueryDef method, Database object, 102-103
CreateRelation method
Database object, 104-106
VBA code for, 105-106
CreateTableDef method
Database object, 106-109
Outlook VBS code for, 108-109
VBA code for, 108
CreateUser method
Group object, 279-280
Workspace object, 66-67
CreateWorkspace method
DBEngine object, 35-36, 48
Type intrinsic constants for, 36
CurrentDb method, 253
Custom database properties, Word vs. Access, 98-101
D[ Top ]
DAO 3.5 object library, setting a reference to, 120
DAO Container objects, 1
DAO object model, 6-9
Containers collections in, 126
Databases collections in, 78
Errors collection and Error object in, 42
Fields collections in, 293
Groups and Users collections in, 271
Indexes collections in, 329
for Jet workspaces, 8, 18
for ODBCDirect workspaces, 9, 19
Parameters collections in, 319
QueryDefs collections in, 140
Recordsets collections in, 171
Relations collections in, 104, 226
TableDefs collections in, 239
Users collections in, 281
Workspaces collection and Workspace object in, 48
DAO object variables, early binding of, 120, 166
Data processing, suspending, 36
Data Source Name (see DSN)
Data typing
explicit, 2
generic vs. specific, 3
variant, 2
Database Containers collection, Container objects in, 127-128
Database object collections, 78-79
Database object methods, 79-80, 95-125
Close, 95-96
CreateProperty, 97-101
CreateQueryDef, 102-103
CreateRelation, 104-106
CreateTableDef, 106-109
Execute, 109-111
MakeReplica, 111-112
NewPassword, 112-113
OpenRecordset, 113-122
PopulatePartial, 122-123
Synchronize, 124-125
Database object properties, 79, 82-95
CollatingOrder, 82-84
Connect, 84-85
Connection, 85-86
DesignMasterID, 86-87
Name, 87-88-
QueryTimeout, 88
RecordsAffected, 88-89
Replicable, 89-91
ReplicaBool, 90
ReplicaID, 91-92
ReplicationConflictFunction, 92-93
Transactions, 93
Updatable, 93
Version, 94-95
V1xNullBehavior, 93-94
Database objects
access to, 80, 354
as children of DBEngine, 360
referencing, 78
retrieving, 81-82
Database variables, auto list members for, 5
Database window, creating TableDefs in, 107
Databases
converted into Design Master, 91
creating, 62
navigating to, 353
removing, 77
replicated, 89, 256
replicating, 61
replicating in a remote folder, 112
saved, 126
selecting for DSN, 71
Databases collection and Database object, 77-125
Databases collection methods, 82
Databases collection properties, 80-82
Count, 80-81
Item, 81-82
Databases collections
in the DAO object model, 78
and the System database, 80
Databases Container, Permissions property (intrinsic constants for), 137
Databasetype argument settings, Connect property, 85, 149-150, 250
DataUpdatable property, Field object, 302
DateCreated property
QueryDef object, 150-151
Recordset object, 183
TableDef object, 251
VBA code for, 150-151, 183, 251
DBEngine objects, 17-42
access to, 25
Database object as a child of, 360
global members of, 25
instantiating new, 12
methods of, 24, 30-41
properties, 26-30
Word VBA code to access, 22
DBEngine properties, 23-24
Access code to display, 19-20
Excel VBA code to display, 20
dbOpenTable constant, 4
dbRunAsync option, 158-159, 195, 203
dbVersion constants, 33
DCount function, 246
Debug window, listings to, 83, 88, 95, 103, 127, 142, 161, 166, 191, 248, 259, 300-301, 307, 326, 344
DefaultCursorDriver property
intrinsic constants, 54-55
VBA code for, 55
Workspace object, 54-55, 203
DefaultPassword property, DBEngine object, 26
DefaultType property
DBEngine object, 26
values of, 26
DefaultUser property
characters not permitted in strings of, 27
DBEngine object, 26-27
DefaultValue property, Field object, 302-303
Delete method
Fields collection, 297-298
Groups collection, 278
Indexes collection, 332-333
Properties collection, 345
QueryDefs collection, 147
Recordset object, 207-208
Relations collection, 232-233
TableDefs collection, 246
Users collection, 285
VBA code for, 147, 207-208, 232-233, 246, 297-298, 332-333, 345
Workspaces collection, 54
Deletes, 207
Description property, Error object, 45-46
Design Master
database converted into, 91
new, showing the GUID, 87
replicating, 86
Design view, query with parameters in, 320
DesignMasterID property, Database object, 86-87
Direction intrinsic constants, 323
Direction property, Parameter object, 323
DistinctCount property, Index object, 334
DLL Access Violation, error message, 357
DoCmd objects, 1
Document objects, extra AllPermissions return values for, 134
DSN, 69-71
creating new, 69-70
naming, 70
selecting database for, 71
dstlocale named constants, 31-32
Dynamic Data Exchange (DDE), 1
E[ Top ]
Early binding, 4-5
of DAO object variables, 120, 166
object references in, 5
(see also late binding)
Edit method, Recordset object, 208
EditMode property, Recordset object, 184-185, 203
End of file (see EOF property)
Enumerations in Object Model Browser, 360-364
EOF property
Move methods with, 180
Recordset object, 185, 216
VBA code for, 185
Error handler, 290
Error messages
ActiveX component can't create object, 20
after converting Access 97 database to Access 2000, 11
DLL Access Violation, 357
Invalid Operation, 219
Item not found in this collection, 147, 202
Method not applicable for this object, 49
Method or data member not found, 90
Object already exists, 102
Object invalid or no longer set, 95
Operation is not supported for this type of object, 86, 149
Table already exists, 244
Error object properties, 43, 45-47
Description, 45-46
HelpContext, 46
HelpFile, 46-47
Number, 47
Source, 47
Error objects, access to, 43
Error properties, message box displaying, 46
Errors collection and Error object, 42-47
in the DAO object model, 42
Errors collection methods, 45
Errors collection properties, 43-44
Example code (see Access VBA code; Excel VBA code; Outlook VBS code; VBA code; VBS code; Word VBA code)
Excel ISAM formats, Windows 98 Registry Editor, 29
Excel VBA code
to display DBEngine properties, 20
for OpenRecordset method, 117-119
Exchange intrinsic constants, Synchronize method, 124
Execute method
Database object, 109-111
Options intrinsic constants for, 162
Outlook VBS code for, 111, 163-164
QueryDef object, 162-164
VBA code for, 110-111, 162-163
Explorer objects, 1
Externally Creatable Objects dialog, 359
F[ Top ]
Field object methods, 294, 316-318
AppendChunk, 316-317
CreateProperty, 317-318
GetChunk, 318
Field object properties, 294, 298-315
AllowZeroLength, 298
Attributes, 299-300
CollatingOrder, 300-302
DataUpdatable, 302
DefaultValue, 302-303
FieldSize, 303
ForeignName, 303-305
Name, 305-306
OrdinalPosition, 306
OriginalValue, 306
Properties, 306-307
Required, 307-308
Size, 308-309
SourceField, 309-310
SourceTable, 310-311
Type, 311-312
ValidateOnSet, 313
ValidationRule, 313-314
ValidationText, 314-315
Value, 315
VisibleValue, 315
Field objects
access to, 294-295
Attributes intrinsic constants for, 299
Properties collection of, 10
in Recordset objects, 313
referencing, 237, 292
FieldAttributeEnum enumeration, 299
Fields collection and Field object, 292-318
Fields collection methods, 293, 296-298
Append, 296-297
Delete, 297-298
Refresh, 298
Fields collection properties, 293, 295-296
Count, 295
Item, 296
Fields collections, DAO object model, 293
Fields property, Index object, 336
FieldSize property, Field object, 303
Files (see BOF property; EOF property)
FillCache method, Recordset object, 209-210
Filter property
Recordset object, 186-187
VBA code for, 186
Find Parents option, 360
Find Paths to Object option, 360
FindFirst method, Recordset object, 210-211
FindLast method, Recordset object, 211-212
FindNext method, Recordset object, 212-213
FindPrevious method, Recordset object, 213-214
Flag values, 368
Foreign property, Index object, 335-336
ForeignName property, Field object, 303-305
ForeignTable property, Relation object, 234
G[ Top ]
GetChunk method, Field object, 318
GetObject function, 12
GetRows method, Recordset object, 214-216
Global view, 370
Group object methods, 279-280
Group object properties, 278-279
Group objects
access to, 273
members of, 272
retrieving, 274
Groups and Users collections, DAO object model, 271
Groups collection and Group object, 271-280
Groups collection methods, 272, 274-278
Append, 274-277
Delete, 278
Refresh, 278
Groups collection properties, 272-274
Count, 273
Item, 273-274
H[ Top ]
HelpContext property, Error object, 46
HelpFile property, Error object, 46-47
I[ Top ]
Idle method, DBEngine object, 36-37
IgnoreNulls property, Index object, 336
IISAM database formats, 333
Imported from Access category, 74
Index object methods, 329, 339-340
CreateField, 339
CreateProperty, 340
Index object properties, 329, 333-339
Clustered, 333
DistinctCount, 334
Fields, 335
Foreign, 335-336
IgnoreNulls, 336
Name, 336-337
Primary, 337-338
Required, 338-339
Unique, 339
Index objects
access to, 330
VBA code for, 329-330
Index property, Recordset object, 187
Indexes collection and Index object, 328-340
Indexes collection methods, 328-329, 331-333
Append, 331-332
Delete, 332-333
Refresh, 333
Indexes collection properties, 328, 330-331
Count, 330
Item, 331
Indexes collections, DAO object model, 329
Inherit property
Container object, 134-135
VBA code for, 135
Inherited property, Property object, 346-347
IniPath property
DBEngine object, 27-28
Word VBA code for, 28
Inspector objects, 1
Installable Indexed Sequential Access Method (see IISAM database formats)
Installation's startup dialog, 355
Instantiating a new or existing object, 358
Intrinsic constants (see Attributes intrinsic constants; CollatingOrder property intrinsic constants; Connect intrinsic constants; Direction intrinsic constants; Exchange intrinsic constants; Lockedits intrinsic constants; Options intrinsic constants; Permissions property intrinsic constants; Prepare setting intrinsic constants; RecordStatus intrinsic constants; Relations Attributes intrinsic constants; TableDef Attributes intrinsic constants; Type intrinsic constants; UpdateOptions intrinsic constants)
ISAM driver settings, 29
IsolateODBCTrans property, Workspace object, 55-56
Item property
Containers object, 132
Databases collection, 81-82
Errors collection, 44
Fields collection, 296
Groups collection, 273-274
Indexes collection, 331
Parameters collection, 322-323
Properties collection, 343
QueryDefs collection, 144
Recordsets collection, 175
Relations collection, 231-232
TableDefs object, 243-244
Users collection, 283-284
Workspaces collection, 52-53
J[ Top ]
Jet DAO, 17-18
versions of, 29-30, 94
Jet databases, opening, 73
Jet workspaces, DAO object model for, 8, 18
Join relationship, 229
Join Type button, 227
Joint Properties dialog, modifying a join relationship, 229
K[ Top ]
KeepLocal property
QueryDef object, 151
setting to ""T,"" 151, 251
TableDef object, 251-252
VBA code for, 151, 252
L[ Top ]
LastModified property, Recordset object, 187-188
LastUpdated property
QueryDef object, 151-152
Recordset object, 188-189
TableDef object, 252-253
VBA code for, 152, 188-189, 253
Late binding, 2-5
VBA code using, 3-4
(see also early binding)
Local tables, 256
Local view, 369
Lockedits intrinsic constants for OpenRecordset method, 115, 165-166, 220-221, 269-270
LockEdits property, Recordset object, 189
Lockedits values/settings, 189
Locking, optimistic, 189
LoginTimeout property
DBEngine object, 28
VBA code for, 57
Workspace object, 56
LogMessages property, QueryDef object, 152
M[ Top ]
Make Data File button, 355-356
Make Model button, 356
MakeReplica method
Database object, 111-112
VBA code for, 112
MaxRecords property, QueryDef object, 153
Methods
BeginTrans, 30
CommitTrans, 30
CompactDatabase, 31-35
CreateDatabase, 35
CreateWorkspace, 35-36
DBEngine object, 30-41
Idle, 36-37
OpenDatabase, 37
RegisterDatabase, 38-39
RepairDatabase, 39-40
Rollback, 40
SetOption, 40-41
(see also Collection methods; Object methods)
Microsoft Access driver, selecting for new DSN, 70
Microsoft Object Browser (see Object Browser)
Microsoft products, Jet versions of, 94
Models (see Object models)
Move method
with BOF and EOF, 180
Recordset object, 216-217
MoveFirst method, Recordset object, 217
MoveLast method, Recordset object, 217-218
MoveNext method, Recordset object, 218
MovePrevious method, Recordset object, 218
MsgBox functions, 96, 129
MSysRepInfo table
DesignMasterID property stored in, 86
ReplicaID property stored in, 92
Multiuser environments, 37, 147, 278, 286, 298, 345
N[ Top ]
Name property
altering, 36
Container object, 135-136
Database object, 87-88
Field object, 305-306
Group object, 278
Index object, 336-337
Name property ([_Fi_]continued )
Parameter object, 324
Property object, 347
QueryDef object, 153-154
read/write characteristics of, 305
Recordset object, 190
Relation object, 235
TableDef object, 253-254
User object, 286
VBA code for, 88, 135-136, 153-154, 190, 253-254, 278, 286, 305-306, 336-337
Workspace object, 56-57
Named constants (see dstlocale named constants; Options named constants)
Naming rules, 56, 153, 286, 347
NewPassword method
Database object, 112-113
User object, 290-291
VBA code for, 113, 290-291
NextRecordset method, Recordset object, 218-219
NoMatch property, Recordset object, 190-191, 210, 212
Nulls
treatment of records with, 336
(see also IgnoreNulls property)
Number property, Error object, 47
O[ Top ]
Object Browser, 351-352, 360
Object data type, 2, 4
Object hierarchies, 353
Object Linking and Embedding (OLE), 1
servers and clients, 1
Object methods
Database, 95-125
Field, 316-318
Group, 279-280
Index, 339-340
QueryDef, 159-169
Recordset, 200-225
Relation, 237-238
TableDef, 262-270
User, 288-291
Workspace, 58-76
Object Model Browser, 351-364
enumerations in, 360-364
icons used by, 368-369
installing, 353-357
introduction, 1-16
menu options, 365-368
reference, 365-370
uninstalling, 356
using, 358-364
Object models, 1-2
Access, 6
accessing, 358
ActiveX Data Objects (ADO), 9-11
DAO, 6-9
for working with Access, 6-11
Object properties
Container, 133-139
Containers, 131-132
Database, 82-95
Error, 45-47
Field, 298-315
Group, 278-279
Index, 333-339
Parameter, 320, 323-327
Property, 346-349
QueryDef, 148-159
Recordset, 176-200
Relation, 233-236
TableDef, 247-261
TableDefs, 243-244
User, 286-288
Workspace, 54-58
Objects
instantiating new or existing, 358
persistent, 49, 175
ODBC Data Source Administrator, 38, 69
ODBC data sources
and the Clustered property, 333
opening connection objects on, 68
ODBCDirect DAO, 17, 19
ODBCDirect workspaces, 54
batch update for, 193
DAO object model for, 9, 19
ODBCTimeout property
overwriting QueryTimeout property, 88
QueryDef object, 154
Office 2000, 2
OLE Automation, 1
OLEView, 351-352
One-to-many relationship, 228
Open Database Connectivity (ODBC), 1
Open event, 121
Open Object Model dialog, 358
OpenConnection method, 54
for non-Access databases, 71
Options intrinsic constants for, 68-69
VBA code for, 71-72
Workspace object, 68-72
OpenDatabase method, 54
DBEngine object, 37
Options intrinsic constants for, 73
Outlook VBS code for, 74-76
for a standard Access database, 37
VBA code for, 73
Workspace object, 72-76
OpenRecordset method
Access VBA code for, 116-117, 166
Database object, 113-122
Excel VBA code for, 117-119
Lockedits intrinsic constants for, 115, 165-166, 220-221, 269-270
Options intrinsic constants for, 114-115, 165, 220, 268-269
Outlook VBS code for, 121-122, 168-169
QueryDef object, 164-169
Recordset object, 219-222
TableDef object, 268-270
Type intrinsic constants for, 114, 164, 219, 268
VBA code for, 221-222, 270
Word VBA code for, 120-121, 166-168
Optimistic locking, 189
Options intrinsic constants, 110
for CreateDatabase method, 62
for Execute method, 162
for OpenConnection method, 68-69
for OpenDatabase method, 73
for OpenRecordset method, 114-115, 165, 220, 268-269
Options named constants
for CompactDatabase method, 32-33
OrdinalPosition property
Field object, 306
read/write characteristics of, 306
OriginalValue property, Field object, 306
Outlook 2000, using VBA code with, 96, 168
Outlook NameSpace, 1
Outlook VBS
creating databases from, 62
imported contact, 74
using the DAO object model from, 63
Outlook VBS code, 15
for Close method, 96
for Container objects, 129-130
for CreateDatabase method, 63-64
for CreateTableDef method, 108-109
for Execute method, 111, 163-164
for GetRows method, 215
to import data into a listbox on an Outlook form, 23
for OpenDatabase method, 74-76
for OpenRecordset method, 121-122, 168-169
Owner property, Container object, 136
P[ Top ]
Parameter object properties, 320, 323-327
Direction, 323
Name, 324
Properties, 324-325
Type, 325-326
Value, 326
Parameter objects
access to, 321
VBA code for, 320-321
Parameters collection and Parameter object, 319-3287
Parameters collection methods, 320, 323
Refresh, 323
Parameters collection properties, 320, 322
Count, 322
Item, 322-323
Parameters collections, DAO object model, 319
Parameters dialog, 319
Partial replicas, relation used to populate, 236
PartialReplica property
Relation object, 235-236
VBA code for, 235-236
Pass-through queries, 84, 157
Password property
User object, 286-288
VBA code for, 287-288
Passwords, changing and clearing, 287
PercentPosition property
Recordset object, 191-192
VBA code for, 191-192
Performance, effects of early and late binding, 5
Permissions
access, 66
from VBA code, 65
Permissions property
Container object, 134, 136-138
VBA code for, 138
Permissions property intrinsic constants
for Container objects, 137
for the Databases Container, 137
for the Tables Container, 137
Personal identifier (see PID properties)
PID property
Group object, 278-279
User object, 288
PopulatePartial method
Database object, 122-123
VBA code for, 123
Prepare property, QueryDef object, 154
Prepare setting intrinsic constants, QueryDef object, 154
Primary property
Index object, 337-338
VBA code for, 338
Properties
DBEngine object, 26-30
DefaultPassword, 26
DefaultType, 26
DefaultUser, 26-27
IniPath, 27-28
LoginTimeout, 28
referencing, 341
SystemDB, 29
Version, 29-30
(see also Collection properties; Object properties)
Properties collection
of a Field object, 10
members of, 342
Properties collection and Property object, 341-349
Properties collection methods, 344-345
Append, 344
Delete, 345
Refresh, 345
Properties collection properties, 343
Count, 343
Item, 343
Properties property
Field object, 306-307
Parameter object, 324-325
VBA code for, 307, 324-325
Property object properties, 346-349
Inherited, 346-347
Name, 347
Type, 347-348
Value, 348-349
Property objects
access to, 342-343
members of, 342
referencing, 341
Q[ Top ]
Queries
pass-through, 84, 157
saved, 114
stored action, 110
structure of, 140
temporary, 145
Query Designer interface, 319
QueryDef object
Prepare setting intrinsic constants for, 154
VBA code for, 142-143
QueryDef object methods, 142, 159-169
Cancel, 159
Close, 159
CreateProperty, 159-161
Execute, 162-164
OpenRecordset, 164-169
QueryDef object properties, 141-142, 148-159
CacheSize, 148-149
Connect, 149-150
DateCreated, 150-151
KeepLocal, 151
LastUpdated, 151-152
LogMessages, 152
MaxRecords, 153
Name, 153-154
ODBCTimeout, 154
Prepare, 154
RecordsAffected, 154-155
Replicable, 155-157
ReplicableBool, 157
ReturnsRecords, 157
SQL, 157-158
StillExecuting, 158
Type, 158-159
Updatable, 159
QueryDef objects, access to, 143
QueryDefs collection in the DAO object model, 140
QueryDefs collection and QueryDef object, 140-169
QueryDefs collection methods, 141, 145-148
Append, 145-146
Delete, 147
Refresh, 147-148
QueryDefs collection properties, 141, 143-144
Count, 143-144
Item, 144
QueryTimeout property
Database object, 88
overwritten by ODBCTimeout property, 88
R[ Top ]
Random numbers, 303
Read Registry button, 355
RecordCount property
Recordset object, 187, 192
TableDef object, 254
VBA code for, 192, 254
RecordsAffected property, 88-89
Database object, 88-89
QueryDef object, 154-155
VBA code for, 89, 155
Recordset method, summary, 200-201
Recordset object methods, 173-174, 200-225
AddNew, 202-203
Cancel, 203
CancelUpdate, 184, 203-204
Clone, 204-205
Close, 205
CopyQueryDef, 206-207
Delete, 207-208
Edit, 208
FillCache, 209-210
FindFirst, 210-211
FindLast, 211-212
FindNext, 212-213
FindPrevious, 213-214
GetRows, 214-216
Move, 216-217
MoveFirst, 217
MoveLast, 217-218
MoveNext, 218
MovePrevious, 218
NextRecordset, 218-219
OpenRecordset, 219-222
Requery, 193, 222-223
Seek, 211, 223-224
Update, 184, 224-225
Recordset object properties, 172-173, 176-200
AbsolutePosition, 178-179
BatchCollisionCount, 179
BatchCollisions, 179
BatchSize, 179
BOF, 180-181, 216
Bookmark, 178, 181-182
Bookmarkable, 182
CacheSize, 182
CacheStart, 183
Connection, 183
DateCreated, 183
EditMode, 184-185, 203
EOF, 185, 216
Filter, 186-187
Index, 187
LastModified, 187-188
LastUpdated, 188-189
LockEdits, 189
Name, 190
NoMatch, 190-191, 210, 212
PercentPosition, 191-192
RecordCount, 187, 192
RecordStatus, 192-193
Restartable, 193-194
Sort, 194-195
StillExecuting, 195
Transactions, 195-196
Type, 196-197
Recordset object properties ([_Fi_]continued )
Updatable, 197-198
UpdateOptions, 198
ValidationRule, 198-199
ValidationText, 200
Recordset objects
access to, 174, 361
creating, 359
duplicating, 204
Field objects in, 313
parents of, 361
properties of, 176-178
referencing, 172
Recordset types
dynaset, 191-192, 196, 217
forward-only, 192, 196
snap-shot, 116, 191-192, 196, 217
table, 120, 197, 211, 328
updatable, 189
uses of, 115-116, 201
Recordsets collection and Recordset object, 170-225
Recordsets collection methods, 175-176
Recordsets collection properties, 175
Count, 175
Item, 175
Recordsets collections
in the DAO object model, 171
members of, 172
RecordsetTypeEnum, members of, 362-363
RecordStatus intrinsic constants, 193
RecordStatus property, Recordset object, 192-193
References dialog, 5-6
References option, 5
Refresh method
Containers collection, 133
Databases collection, 82
Errors collection, 45
Fields collection, 298
Groups collection, 278
Indexes collection, 333
Parameters collection, 323
Properties collection, 345
QueryDefs collection, 147-148
Recordsets collection, 175-176
Relations collection, 233
TableDefs collection, 247
Users collection, 286
VBA code for, 133, 148
Workspaces collection, 54
RefreshLink method, TableDef object, 270
RegisterDatabase method
DBEngine object, 38-39
VBA code for, 38-39
Registry option button, 355
Relation Attributes return values/settings, 234
Relation object methods, 230, 237-238
CreateField, 237-238
Relation object properties, 230, 233-236, 304
Attributes, 233-234
ForeignTable, 234
Name, 235
PartialReplica, 235-236
Table, 236
Relation objects
access to, 230
appending, 104
referencing, 104
retrieving, 231-232
VBA code for, 227
Relations Attributes intrinsic constants, 104-105
Relations collection and Relation object, 226-238
Relations collection methods, 230, 232-233
Append, 232
Delete, 232-233
Refresh, 233
Relations collection properties, 229-232
Count, 230-231
Item, 231-232
Relations collections in the DAO object model, 104, 226
Relationship join types, 229
Relationships window
creating new relationship in, 104, 226, 228
one-to-many relationship in, 228
Remote folder, replicating a database in, 112
RepairDatabase method
DBEngine object, 39-40
VBA code for, 39-40
Replica filters, changing, 123
Replicable choice, when creating new table, 255-256
Replicable property
Database object, 89-91
QueryDef object, 155-157
setting to ""T,"" 90, 156, 255
TableDef object, 255-257
VBA code for, 90-91, 156-157, 256-257
ReplicableBool property
QueryDef object, 157
TableDef object, 257
ReplicaBool property, Database object, 90
ReplicaFilter property
TableDef object, 257-258
VBA code for, 258
ReplicaFilter return value/settings, 257-258
ReplicaID property
Database object, 91-92
stored in the MSysRepInfo table, 92
VBA code for, 91-92
Replicated databases, 256
synchronizing, 123
Replication Manager, 124
ReplicationConflictFunction property, Database object, 92-93
Requery method
Recordset object, 193, 222-223
VBA code for, 222-223
Required property
Field object, 307-308
Index object, 338-339
read/write characteristics of, 308
Restartable property
Recordset object, 193-194
VBA code for, 193-194
ReturnsRecords property, QueryDef object, 157
Rollback method
DBEngine object, 40
VBA code for, 58-59
Workspace object, 76
Runtime errors (see Error messages)
S[ Top ]
Saved queries, 114
Seek method
Recordset object, 211, 223-224
VBA code for, 223-224
SetOption method
in the Access Application object, 40-41
DBEngine object, 40-41
VBA code for, 40-41
setup.exe, 353
Show Origins option, 360
Size property
Field object, 308-309
read/write characteristics of, 308
VBA code for, 309
Sort property
Recordset object, 194-195
VBA code for, 194-195
Source property
Error object, 47
SourceField property
Field object, 309-310
read/write characteristics of, 309-310
VBA code for, 310
SourceTable property
Field object, 310-311
read/write characteristics of, 309-310
SourceTableName property
TableDef object, 259
VBA code for, 259
SQL property
QueryDef object, 157-158
SQLExecDirect function, 154
SQLPrepare function, 154
Startup dialog, 355
StillExecuting property
QueryDef object, 158
Recordset object, 195
Stored action queries, 110
String variables, 3
Synchronize method
Database object, 124-125
Exchange intrinsic constants for, 124
VBA code for, 124-125
System database, 80
SystemDB property
DBEngine object, 29
T[ Top ]
Table property
Relation object, 236
TableDef Attributes intrinsic constants, 107, 247-248
TableDef object methods, 241, 262-270
CreateField, 262-263
CreateIndex, 263-265
CreateProperty, 265-267
OpenRecordset, 268-270
RefreshLink, 270
TableDef object properties, 241, 247-261
Attributes, 247-248
ConflictTable, 248-249
Connect, 249-251
DateCreated, 251
KeepLocal, 251-252
LastUpdated, 252-253
Name, 253-254
RecordCount, 254
Replicable, 255-257
ReplicableBool, 257
ReplicaFilter, 257-258
SourceTableName, 259
Updatable, 259-260
ValidationRule, 260-261
ValidationText, 261
TableDef objects
access to, 243
VBA code for, 242-243
TableDefs collection and TableDef object, 239-270
TableDefs collection methods, 244-247
Append, 244-245
Delete, 246
Refresh, 247
TableDefs collections
in the DAO object model, 239
members of, 240-241
TableDefs object properties, 243-244
Count, 243
Item, 243-244
Tables Container, Permissions property (intrinsic constants for), 137
Temporary queries, 145
Timeouts (see LoginTimeout property)
Tools menu, 5
Transactions property
Database object, 93
Recordset object, 195-196
VBA code for, 196
Type intrinsic constants
for CancelUpdate method, 203
fo r Cr eateField method, 262-263
for CreateProperty method, 97-98, 160, 266-267
for CreateWorkspace method, 36
for OpenRecordset method, 114, 164, 219, 268
for setting return values, 158-159, 196
for Update method, 224
for Workspace object method, 57
Type property
Field object, 311-312
Parameter object, 325-326
Property object, 347-348
QueryDef object, 158-159
Recordset object, 196-197
VBA code for, 197, 312, 326
Workspace object, 57
Type property intrinsic constants, 311, 325, 347-348
U[ Top ]
Undoing deletes, 207
Unique property, Index object, 339
Updatable property
Database object, 93
QueryDef object, 159
Recordset object, 197-198
TableDef object, 259-260
VBA code for, 93, 197-198, 260
Update method
Recordset object, 184, 202, 224-225
Type intrinsic constants for, 224
VBA code for, 225
UpdateOptions intrinsic constants, return value/settings, 198
UpdateOptions property, Recordset object, 198
Updating system files, 354
User object methods, 282, 288-291
CreateGroup, 288-290
NewPassword, 290-291
User object properties, 282, 286-288
Name, 286
Password, 286-288
PID, 288
User objects
access to, 283
characteristics of, 281-282
referencing, 279, 282, 284
UserName property
Container object, 138-139
VBA code for, 138-139
Workspace object, 58
Users collection and User object, 281-291
Users collection methods, 282, 284-286
Append, 284-285
Delete, 285
Refresh, 286
Users collection properties, 282-284
Count, 283
Item, 283-284
Users collections, DAO object model, 281
V[ Top ]
ValidateOnSet property, Field object, 313
ValidationRule property
Field object, 313-314
read/write characteristics of, 313
Recordset object, 198-199
TableDef object, 260-261
VBA code for, 199, 261, 314
ValidationText property
Field object, 314-315
read/write characteristics of, 314-315
Recordset object, 200
TableDef object, 261
Value property
Field object, 315
Parameter object, 326
Property object, 348-349
VBA code for, 348-349
Variant data type, 2
VBA code
for AbsolutePosition property, 178-179
to access the DBEngine object, 22
for AddNew method, 202-203
advantages of, 14-15
for AllPermissions property, 134
for Append method, 53-54, 145-146, 232, 245, 275, 277, 284-285, 296-297, 331-332, 344
for AppendChunk method, 312-313
for Attributes property, 248, 300
for BeginTrans method, 58-59
for BOF property, 180-181
for Bookmark property, 181-182
for CancelUpdate method, 204
for Clone method, 205
for Close method, 95
for CollatingOrder property, 83-84, 301-302
for CommitTrans method, 58-59
for CompactDatabase method, 33-35
for ConflictTable property, 248-249
for Connect property, 150, 250-251
for the Container object, 127, 129
for CopyQueryDef method, 206-207
for Count property, 51-52, 81, 131-132, 231, 283, 295
for CreateDatabase method, 62-63
for CreateField method, 237-238
for CreateGroup method, 65-66, 288-290
for CreateIndex method, 264-265
for CreateProperty method, 101, 161, 267
for CreateQueryDef method, 103
for CreateRelation method, 105-106
for CreateTableDef method, 108
for CreateUser method, 66-67, 279-280
for DateCreated property, 150-151, 183, 251
for DefaultCursorDriver property, 55
for Delete method, 147, 207-208, 232-233, 246, 297-298, 332-333, 345
for Description property, 45-46
for DesignMasterID property, 86-87
for DistinctCount property, 334
for Edit method, 208
for EditMode property, 184-185
for EOF property, 185
for Execute method, 110-111, 162-163
for FillCache method, 209-210
for Filter property, 186
for FindFirst method, 211
for FindLast method, 211-212
for FindNext method, 212-213
for FindPrevious method, 213-214
for Foreign property, 335-336
for ForeignName property, 304-305
for ForeignTable property, 234
for GetRows method, 215-216
for Idle method, 36-37
for Index object, 329-330
for Inherit property, 135
for Inherited property, 346-347
VBA code ([_Fi_]continued )
for KeepLocal property, 151, 252
for LastModified property, 187-188
for LastUpdated property, 152, 188-189, 253
for LoginTimeout property, 57
for LogMessages property, 152
for MakeReplica method, 112
for Move method, 217
for MoveLast method, 218
for Name property, 88, 135-136, 153-154, 190, 253-254, 278, 286, 305-306, 336-337
for NewPassword method, 113, 290-291
for OpenConnection method, 71-72
for OpenDatabase method, 73
for OpenRecordset method, 221-222, 270
for Owner property, 136
for Parameter object, 320-321
for PartialReplica property, 235-236
for Password property, 287-288
for PercentPosition property, 191-192
permissions from, 65
for Permissions property, 138
for PopulatePartial method, 123
for Primary property, 338
for Properties property, 307, 324-325
for the QueryDef object, 142-143
for RecordCount property, 192, 254
for RecordsAffected property, 89, 155
for Refresh method, 133, 148
for RegisterDatabase method, 38-39
for Relation object, 227
for RepairDatabase method, 39-40
for Replicable property, 90-91, 156-157, 256-257
for ReplicaFilter property, 258
for ReplicaID property, 91-92
for Requery method, 222-223
for Restartable property, 193-194
for Rollback method, 58-59
for Seek method, 223-224
for SetOption method, 40-41
for Size property, 309
for Sort property, 194-195
for SourceField property, 310
for SourceTableName property, 259
for Synchronize method, 124-125
syntactical differences from VBS code, 15-16, 96, 107-108, 128-129
for TableDef object, 242-243
for Transactions property, 196
for Type property, 197, 312, 326
for Updatable property, 93, 197-198, 260
for Update method, 225
for UserName property, 138-139
using early binding, 4
using late binding, 3-4
using with Outlook 2000, 96
for ValidationRule property, 199, 261, 314
for Value property, 348-349
for Version property, 30, 94-95
versions of, 13
(see also Access VBA code; Excel VBA code; Word VBA code)
VBA Err object, 42, 45
VBS code, 15
for CollatingOrder property, 84
syntactical differences from VBA code, 15-16, 96, 107-108, 128-129
versions of, 13
(see also Outlook VBS code)
VBScript, 2, 4
Version property
Database object, 94-95
DBEngine object, 29-30
VBA code for, 30, 94-95
Versions
application, 29-30
Jet Engine, 29-30
VBA, 13
VBS, 13
VisibleValue property, Field object, 315
Visual Basic for Applications (VBA), 2-7
Visual Basic programmers, tools for, 351
Visual Basic (VB) dialects, 1-2, 11-16
listed, 13-14
(see also VBA code; VBS code)
V1xNullBehavior property, Database object, 93-94
W[ Top ]
Windows 3.0 clipboard, 1
Windows 98 Registry Editor, Excel ISAM formats in, 29
Windows Office 2000, 2
Word custom database properties, Access vs., 98
Word Range object, 1
Word table, data imported into, 21, 166
Word VBA code
to access the DBEngine object, 22
for IniPath property, 28
for OpenRecordset method, 120-121, 166-168
Workgroup
confirmation message on joining, 277
file name of, 276
selecting, 276
Workgroup Administrator, 29, 275-276
Worksheet_Open event, 117
Workspace collections, 50
Workspace object methods, 30, 37, 40, 50, 58-76
BeginTrans, 58-59
Close, 60
CommitTrans, 60
CreateDatabase, 60-64
CreateGroup, 64-66
CreateUser, 66-67
OpenConnection, 68-72
OpenDatabase, 72-76
Rollback, 76
Type intrinsic constants for, 57
Workspace object properties, 50, 54-58
DefaultCursorDriver, 54-55, 203
IsolateODBCTrans, 55-56
LoginTimeout, 56
Name, 56-57
Type, 57
UserName, 58
Workspace objects
naming rules, 56
referencing, 49
removing, 60
retrieving, 52
Workspaces collection and Workspace object, 48-76
in the DAO object model, 48
Workspaces collection methods, 30, 49, 53-54
Append, 53-54
Delete, 54
Refresh, 54
Workspaces collection properties, 49, 51-53
Count, 51-52
Item, 52-53
X[ Top ]
XREF, 263, 328
Overview
Each iteration of Windows has meant a corresponding improvement in the techniques used for transferring data among its applications. Today's leading technique is called Automation. It allows you to work directly with objects in an application's interface using their object models. But if you want to write code in a programming language, such as Visual Basic, in order to work with the apps that support Automation, you must understand the inner workings of an application's object model—or in the case of Microsoft's...