Using DBI ActiveX (COM) Objects in ASP / ASP.NET


The most important fundamental concepts when working with ActiveX controls in a web-based interface are the following:

 

 

The ActiveX control is instantiated and hosted by the client's browser; NOT by the web server. The developer must always bear in mind that the ActiveX object and the Browser form a single application which runs only at the client machine. It is completely separated from the web server. The ActiveX object is invisible to the web server. It is instantiated and coded using HTML output (which is rendered at the client). ASP script (which is executed only at the server ... Not at the client) which attempts to access the ActiveX control will fail; the ActiveX control does not exist to the server. Rather, the ASP page must include HTML output that will create an instance of the object at the client (using the HTML "Object" tag) and HTML scripted events for the object that will execute at the client.

 

Data management and web services form a single application running at the Server. Data to and from the ActiveX control is data to and from the application (browser + ActiveX control) on the client-side.

 

For a client-side control such ctSchedule, which reads and writes XML at the client-side, ADO.NET's XML services are an ideal strategy for forming a middle-tier service that bridges the client-side application (browser + ActiveX control) and the server-side application (web server and data services).

 

The following links are helpful for getting up to speed on ASP development using ActiveX controls:

 

Introduction to ASP.NET Web Applications in Visual Studio: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontowebapplicationsinvisualstudio.asp

See especially topics entitled:

- "Web-based Components: XML Web Services"

- "Web Application Data Access"

(noting that ctSchedule reads (client-side or via HTML protocol) / writes XML (client-side only))

 

Introduction to Data Access with ADO.NET: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconfundamentaldataconceptsinvisualstudionet.asp

See especially topics entitled:

- "Datasets Are Independent of Data Sources"

- "Data Is Persisted as XML"

- "Components of ADO.NET" (excellent illustration of the model)

 

Recommendations for Data Access Strategies: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconusingdatacommandversususingdatasets.asp

See especially topics entitled:

- "Storing Data in Datasets"

- "XML Web Services"

 

Introduction to Datasets:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbcondatasets.asp

See especially topics entitled:

- "Datasets, Schemas, and XML"

"You can read an XML document or stream into a dataset using the dataset's ReadXML method and write a dataset out as XML using the dataset's WriteXML method. Because XML is a standard interchange format for data between different applications, this means that you can load a dataset with XML-formatted information sent by other applications. Similarly, a dataset can write out its data as an XML stream or document, to be shared with other applications or simply stored in a standard format."

 

Introduction to ADO.NET Connection Design Tools: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vburfintroductiontoadoconnectiondesigntools.asp