Microsoft KB Archive/195016

= ADO2VJ6 Demonstrates Using the ADO 2.0 dll Directly =

Article ID: 195016

Article Last Modified on 8/9/2004

-

APPLIES TO


 * Microsoft Visual J++ 6.0 Standard Edition
 * Microsoft ActiveX Data Objects 2.1 Service Pack 2

-



This article was previously published under Q195016



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:

194813 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:

Ado2vc6.exe

Adovj6.exe

Release Date: NOV-02-1998

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.   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://msdn.microsoft.com/dataaccess/

