| SAMPLE: ATL2ADO.exe Returns Disconnected ADO RecordsetID: Q200122 
 | 
ATL2ADO.exe is a sample that demonstrates a minimal three-tiered Database Application using ADO 2.0. It also demonstrates the following:
The following file is available for download from the Microsoft
Software Library:
ATL2ADO.exeRelease Date: Mar-02-1999
Q119591 How to Obtain Microsoft Support Files from Online Services
FileName                   Size
---------------------------------------------------------
adostudent.mdb             72
readme.txt                 491
helper.idl                 21
R1ADOdrsExe.aps            4332
R1ADOdrsExe.cpp            4447
R1ADOdrsExe.dsp            12760
R1ADOdrsExe.dsw            545
R1ADOdrsExe.h              84
R1ADOdrsExe.idl            756
R1ADOdrsExe.ncb            33792
R1ADOdrsExe.rc             2941
R1ADOdrsExe.rgs            185
R1ADOdrsExeps.def          253
R1ADOdrsExeps.mk           502
r1DisRS.cpp                473
r1DisRS.h                  891
r1DisRS.rgs                645
resource.h                 549
StdAfx.cpp                 315
StdAfx.h                   1091 
"SELECT * FROM Student WHERE GradYear > ?" 
getRS([in,optional,defaultvalue(88)] short GY, [out, retval]_Recordset **ppRS);
ConnString([in] BSTR newVal);
UpdateBat( _Recordset *ppRS); 
struct _Recordset;
#if !defined(__cplusplus) || defined(CINTERFACE)
   typedef struct _Recordset _Recordset;
#endif 
#undef EOF                          // Necessary for EOF collision.
#import "msado15.dll" no_namespace  // Correct place to import ADO. 
nmake /f R2ADOmodps.mk
regsvr32  R1ADOdrsExeps.dll 
Set idrs = CreateObject("R1ADOdrsExe.r1DisRS", "Computer1") 
// Use the following SQL to create the student table on SQL Server.
   CREATE TABLE student
      (studentID int IDENTITY (1000, 1) NOT NULL ,
      name text NULL ,
      gradYear int NULL )
   GO
   INSERT INTO student (name, gradYear)
   VALUES ('Billy Reubin', 99)
   go
   INSERT INTO student (name, gradYear)
   VALUES ('Joe Mana', 98)
   go
   INSERT INTO student (name, gradYear)
   VALUES ('Willy Klifton', 69)
   go
   INSERT INTO student (name, gradYear)
   VALUES ('Lerry ElvisSon', 73)
   go 
For additional information, please see the following 
articles in the Microsoft Knowledge Base:
Q182389 FILE: Adovcbm.exe ADO 1.5 with #import and Getrows/Bookmarks
Q184968 FILE: Adovcsp.exe Demonstrates Using Stored Procedures with ADO
Q186387 SAMPLE: Ado2atl.exe Returns ADO Interfaces from COM
Q181733 FILE: Adovcbtd.exe #import Using UpdateBatch and CancelBatch
© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Rick Anderson, Microsoft Corporation
Additional query words:
Keywords          : kbfile kbsample kbDatabase kbSDKDataAc kbVBp600 kbVC600 
Version           : WINDOWS:2.0,6.0; winnt:6.0
Platform          : WINDOWS winnt 
Issue type        : Last Reviewed: March 29, 1999