Using ADO Extensions

Data is stored and maintained in different data sources. Some data source applications include MS-Access, SQL Server, Oracle, and Sybase. Each data source uses its own native syntax. Therefore, when you need to manage data stored in data sources from your applications, you would prefer to use standard objects and syntaxes irrespective of the data sources. It is inconvenient to use different objects, methods, and syntaxes to manage different data sources. ADOX provides a set of standard objects that you can use to manage data stored in different data sources.

ActiveX Data Objects Extensions (ADOX) is an extension of the ADO objects and programming model that allows creation, modification, and manipulation of schema objects, such as databases, tables, and columns. ADOX also includes security objects that enable you to maintain users and groups that access the schema objects. ADOX security objects can be used to grant and revoke permissions on objects that are accessed by different users and groups.


You can use ADOX objects in your Web applications to manage data stored in different data sources. However, before you can use ADOX objects, you need to establish a reference to the ADOX type library. The name of the ADOX library is Msadox.dll. To establish a reference to this type library, select Add Reference from the Project menu. Then, you can specify the path for the library.

ADOX requires an interop assembly. When you add reference for the ADOX library, a dialog box appears asking you if you want to generate an interop wrapper. At this stage, click Yes to add the ADOX reference.

Afte r adding the reference to the type library, you can go ahead and write the code to create databases, tables, or columns in a table.

To create a database, use the following syntax:

Dim ObjectName as New ADOX.Catalog
ObjectName.Create "Provider = Name of the provider; Data Source = Path of the database"

In this syntax:

ObjectName refers to the instance of the ADOX Catalog object.

The Create method takes two parameters:

Provider: Specifies the name of the database provider.

The different providers include Microsoft OLE DB

Provider for ODBC, Microsoft OLE DB Provider for the Microsoft Jet Database Engine, Microsoft OLE DB Provider for Oracle, and Microsoft OLE DB Provider for SQL Server.

Data Source: Specifies the path where you want to create the database.

In addition to managing data with ADOX objects, you can set the security options associated with different schema objects. Before you can use the ADOX objects to set user or group permissions, you must open the connection with the system database that stores all security information. Then, you can use the GetPermissions and SetPermissions functions to grant and revoke user or group access permissions on an object.

related post

CREATING ASSEMBLIES WITH ASP.NET

BUILDING HANDLERS IN ASP.NET

INTERFACES AND CLASSES CREATION IN ASP.NET

CACHING IN ASP.NET

CACHING IN ASP.NET PART TWO

WIRE LESS APPLICATION WITH ASP.NET

SECURITY IN ASP.NET PART ONE

SECURITY IN ASP.NET PART TWO

LOCALIZING ASP.NET APPLICATIONS

DEPLOYING ASP.NET APPLICATIONS

ASP.NET CONFIGURATION SYSTEM

WEB SERVICES IN ASP.NET

WEB SERVICES PART TWO

WEB SERVICE INFRASTRUCTURE

WEB SERVICE INFRASTRUCTURE PART TWO

EXCHANGING MESSAGES IN ASP.NET

MICROSOFT HAIL STORM

SOAP AND DOT NET PART ONE

SOAP AND DOT NET PART TWO


No comments:

Post a Comment