ADO2VJ6 Demonstrates Using the ADO 2.0 dll Directly

ID: Q195016


The information in this article applies to:
  • Microsoft Visual J++, version 6.0
  • ActiveX Data Objects (ADO), version 2.1 SP2


SUMMARY

Ado2vj6.exe is a sample that demonstrates using COM/ADO with Visual J++ 6.0.

With Visual J++ 6.0, ActiveX Data Objects (ADO) can be accessed directly (by creating a COM wrapper around the Msado15.dll) or through the Windows Foundation Classes (WFC) wrapper class com.ms.wfc.data. The WFC/ADO approach is easier to use because the method arguments usually take native Java types. The COM/ADO approach requires VARIANT arguments for a number of methods. While the WFC/ADO approach is simpler, it does have two drawbacks:

  • Not all ADO methods and properties are available. Method names are also different (for example, MoveNext is lower-case "moveNext").


  • The documented constants have new names. This problem can be resolved by including the class adoCon.java from the sample referred to in the following article in the Microsoft Knowledge Base:


  • Q194813 SAMPLE: WFCADO Demonstrates Using WFC ADO with Visual J++ 6.0
This sample is the ADO/COM version of the sample WFCado (which takes the WFC/ADO approach). You can compare the two samples to see the complexity of using safe arrays in ADO/COM versus passing native values in the WFC/ADO approach.


MORE INFORMATION

The following files are available for download from the Microsoft Download Center. Click the file names below to download the files:

Ado2vc6.exe
Adovj6.exe
Release Date: NOV-02-1998

For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

   FileName               Size
   ---------------------------------------------------------

   Codebase.dat              1
   Form1.class               2
   RS1.sln                   1
   RS1.suo                   5
   RS1.vjp                   5
   Student.mdb             116
   ADO2VJ6.class             9
   ADO2VJ6.java              9 
To build this file, you will need to build a COM wrapper around ADO 2.0. You can build a COM wrapper by going to the Project menu and selecting "Add COM Wrapper ...". In the "COM Wrappers" dialog box, select the check box "Microsoft ActiveX Data Access 2.0 Library" and click OK.

To run this sample, you must have ADO 2.x installed. You can get ADO from the Microsoft Data Access Software Development Kit (SDK) and the Microsoft Data Access Components Version 2.0 from the following Web site:
http://www.microsoft.com/data/m


REFERENCES

For additional information, please see the following article(s) in the Microsoft Knowledge Base:

Q194813 SAMPLE: WFCADO Demonstrates Using WFC ADO with Visual J++ 6.0
(c) Microsoft Corporation 1998. All Rights Reserved. Contributions by Rick Anderson, Microsoft Corporation.

Additional query words:

Keywords : kbfile kbsample kbDatabase kbVJ600 kbGrpMDAC kbDSupport kbADO210sp2
Version : WINDOWS:2.1 SP2,6.0
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: December 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.