Show All

# NewADODBConnection Method

Creates and returns a reference to an empty ActiveX Data Objects (ADO) Connection object.

expression.NewADODBConnection() ADODB.Connection

expression Required. An expression that returns a reference to the Application object.

returns A reference to an ADO Connection object.

## Security Level

3: Can be accessed only by fully trusted forms.

## Remarks

If the form is not fully trusted, the NewADODBConnection method will return a "permission denied" error.

## Example

In the following example, the NewADODBConnection method of the Application object is used to set a reference to an empty ADO Connection object:

    var objADOConnection;

    objADOConnection = Application.NewADODBConnection();

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp