Mapping Microsoft Data Access Object 3.1

4 downloads 152697 Views 67KB Size Report
Jan 31, 1996 - products include Microsoft Excel version 5.0 and later, Microsoft Access ... graphics application such as Adobe™ PageMaker™, CorelDRAW®, ...
Mapping the Data Access Object: DAO 3.1 (for ODBC Direct Data Sources) (Archived V... Page 1 of 3

MSDN H om e > MSDN Libra ry Archiv e >

Archived content. No warranty is made as to techni cal accuracy. Cont ent may c on tain URLs t hat were vali d when origin ally publis hed, but now link to sit es or pages that no l on ger exist. Vis ual Basi c 4.0 Techni cal Artic les

Mapping the Data Access Object: DAO 3.1 (for ODBC Direct Data Sources) Ken Las sesen Mi cros oft D eveloper Network Technology Group January 3 1, 1996

Abstract This art icle pres ents a graph ic map of t he D ata Acc es s Object (DAO) object model, version 3 .1 ,as the model applies to Open Database Connecti vi ty (ODBC) data sources connect ed d irect ly to DAO rather than to the Microsoft ® Jet dat abase en gine (as was req uired in p revious vers ions). This is an i mplementation of features foun d i n the Vi sual Basic ® 4.0 Remote Data Objec t (RDO). The map shows the new DAO 3.1 properties , method s, an d child object s avail ab le when di rectl y c on nected to an OD BC data sourc e.

Data Access Object 3.1 The D ata Acc es s Object (DAO) version 3 .1 objec t model for Open Dat abas e Connect ivity (ODBC) direct data sources presented in t his article is a s ubset of the full DAO vers ion 3.1 object model. The objects, methods , and properti es shown are those that appl y onl y t o ODBC direct data sources.

8 /1

1 1 / 4

0 0 2 s

t n

Figure 1. Relationship between Data Access Object 3.1 and other data components DAO is available in Visual C++® an d many products b as ed on Mi cros oft ® Vis ual Basi c ® for Appl ication s. These product s incl ude Micros oft Excel version 5 .0 an d later, Microsoft Access 95 , Vis ual Basi c version 4 .0, an d Vis ual C++ version 4.0. D AO may be used from any DAO 3.0 li censed host t hat can call an OLE Automation s erver, suc h as Mi cros oft Projec t. For informati on on using D AO, s ee your produc t documentati on an d search th e Mic rosoft Devel opmen t Library. The bibl iography directs you to some key articl es. DAO has gone through several vers ions, as shown in Table 1.

e m e r i u q e R

Table 1. DAO Version Used in Various Microsoft Products DAO version 1.0

Microsoft products Vis ual Basi c 2.0, Visual Basic 3.0 , Mi crosoft Access 1.1

http://msdn.microsoft.com/archive/en-us/dnarvb4/html/msdn_mpdao310.asp?frame=true

10/20/2007

Mapping the Data Access Object: DAO 3.1 (for ODBC Direct Data Sources) (Archived V... Page 2 of 3

2.0 2.5 3.0 3.1

Mi cros oft Acces s 2.0 Vis ual Basi c 4.0 (16 -bit only) Vis ual Basi c 4.0, Microsoft Ac cess 95 , Mic rosoft Excel 9 5, Vis ual C++ 4.0 Separate release for exi sting 3 .0 hosts

Fig ure 2 shows the rel ationsh ip between objects as descri bed by t he Object Browser and onli ne Help files. A map serves as a good learnin g ai d and a qu ick referenc e for d evelopers. After produc ing a map, I found that it was easy to work with t he object : I ju st post th e appropri at e map on my wal l for quic k reference, wh ich is a lot fast er than clicki ng objec ts in a Help file one by one to discover t heir properti es an d met hods. For an introducti on to using OLE Automati on, see "Usi ng Micros oft OLE Servers to Develop Sol utions." Because Figure 2 is unreadab le on line, I have incl uded the two mos t common graphi cs formats — en capsulated Pos tSc ript ™ (.EPS) and Wi ndows ® metafil e (.WMF)— as well as a copy of my origin al Shapeware™ Vi sio™ versi on 4.0 file (.VSD). Th e first two formats c an b e opened and th e maps printed across mult iple pages usi ng Micros oft Exc el or a commerci al graphi cs applic ation suc h as Adobe™ PageMaker™, Corel DRAW ®, or Microsoft Publis her. The origin al Vis io file is in cluded for th ose who wish t o modi fy the di agram.

8 /1

1 1 / 4

t n

e m e r i u q e R Figure 2. Map of the Data Access Object 3.1

0 0 2 s

Outdated Items

Outdated i tems in DAO versi on 2.5 are not available in t his vers ion, for exampl e, CreateDynaset. You mus t replac e these items in your code.

Object Definitions

http://msdn.microsoft.com/archive/en-us/dnarvb4/html/msdn_mpdao310.asp?frame=true

10/20/2007

Mapping the Data Access Object: DAO 3.1 (for ODBC Direct Data Sources) (Archived V... Page 3 of 3

The object s and collect ions in Figu re 2 are defined in Table 2. Table 2. Object and Collection Definitions Object or Collection DBEngine object

Workspaces c ollecti on Workspace object

Databases c ollecti on Database object Errors c ollecti on Error object Connections c ollecti on Connection object QueryDefs c ollecti on QueryDef object Parameters c ollecti on Parameter object Recordsets c ollecti on Recordset object Pr operties c ollecti on Pr operty object Fields c ollecti on Field object

Definition Is the top -level object , represent ing the data source— the Mi cros oft Jet database en gine or an OD BC data source. Contai ns and controls all ot her objects in the hierarchy of dat a acc ess objects. Cont ai ns all Workspace ob ject s of t he DBEngine object . Defines a session i n a s pecific environment, for example, Jet or ODBC. It contai ns open dat abases and ODBC connecti ons and provid es mec hanisms for s imultan eous transac tions. Cont ai ns all open Database object s opened or created in a Workspace object . Repres ents an open database. Cont ai ns all st ored Error object s, eac h of whic h pertain s to a s ingle operat ion involving data acces s objec ts. Cont ai ns details ab ou t eac h data access error t hrown from a singl e operation. Cont ai ns all st ored Connection object s of a Workspace. Is a network connect ion to an ODBC direc t data sourc e (Microsoft Wind ows NT™ SQL Server, ORACLE ®). Cont ai ns all QueryDef object s in a Connection object . Is a stored d efi nition of a query. Off of a Connection object , t his is t he prepared statement on the OD BC source. Cont ai ns all th e Parameter object s of a QueryDef object . Is a parameter ass ociated with a QueryDef object c reated from a parameter qu ery. Cont ai ns all open Recordset object s in a Database object or in a Connection object . Cons ists of the rec ords i n a bas e tabl e or the records ret urned from a query. Cont ai ns all th e Pr operty object s for a specific i nstanc e of an object. Is a buil t -in charac teris tic or a us er-defi ned c haract erist ic of a d at a ac cess object. Cont ai ns all st ored Field object s of a Recordset object . Is a column of data with a common data type and a c ommon s et of properti es.

Bibliography

8 /1

Lasses en , Ken. "Mappin g the Data Ac cess Ob ject : DAO 3 .0 ." (MSDN Li brary, Techn ical Arti cles) Lasses en , Ken. "Usi ng Microsoft OLE Servers to Develop Sol utions ." (MSDN Li brary, Techn ical Arti cles)

1 1 / 4

Manage Your Profile | Legal | Contact Us | MSDN Flash New sletter © 2007 M icrosoft Corpora tion. All rights reserv ed. Terms of Use | Tra demark s | Priva cy Statem ent

0 0 2 s

t n

e m e r i u q e R

http://msdn.microsoft.com/archive/en-us/dnarvb4/html/msdn_mpdao310.asp?frame=true

10/20/2007