Microsoft KB Archive/169807

-

{| The information in this article applies to:
 * width="100%"|
 * Microsoft Win32 Virtual Machine for Java
 * ActiveX Data Objects 1.0

SUMMARY
ActiveX Data Objects (ADO) are freely redistributable; however, you do have to pass a license key when using ADO 1.0 in order to properly instantiate ADO.

ADO/R, the Recordset-only version of ADO, does not require a license key.

MORE INFORMATION
The following program shows how to pass the license key to the first object you create with ADO. Before compiling and running this program, perform the following steps:


 * 1) Make sure you have registered ADO; see http://www.microsoft.com/oledb/download/download.htm#Update for more information.
 * 2) Run "JAVATLB.EXE /U:T msado10.dll" from the Program Files\Common Files\System\ADO folder.

The following code calls the ADO getConnectionTimeout function: // Sample program to call the ADO getConnectionTimeout function. import msado10.*; import com.ms.com.*; public class ADOTest { public static void main(String args[]) {      // Create the License Manager object _Connection MyADOConnection=null; ILicenseMgr mgr = new LicenseMgr; MyADOConnection = (_Connection) mgr.createWithLic(                              // The license key for ADO                               "gxwaezucfyqpwjgqbcmtsncuhwsnyhiohwxz",                               // The CLSID for ADO Connection                               "{00000293-0000-0010-8000-00AA006D2EA4}",                               // The aggregation IUnknown* punkOuter                               null,                               // The ctxFlag to create in inproc server                               ComContext.INPROC_SERVER  ); int timeout = MyADOConnection.getConnectionTimeout; System.out.println("getConnectionTimeout returned "+timeout); }  }