.net – How to scan and count controls present in DataAccessPage of Access DataBase programmatically

ms-accessvb.net

As per my application (Vb.net), it scans the Access database for Active-X controls.

It is working now for Report form and Access Form.

The code to find out controls is as follows:

    oReportCtls = oReport.Controls
        For Each oReportCtl In oReportCtls
            If oReportCtl.ControlType = 119 Then 'Activex Control'
                intReportObjectCount = intReportObjectCount + 1
            End If
        Next

But for DataAccessPages I am not getting any reference for Controls.

Need Help:

Please let me know it is possible or not? If yes, then please provide me some reference or example.

Many Many Thanks,
Sugam

Best Answer

Since pages are HTML, I suggest loading the page into an embedded browser and use DOM.

I do not have specific code, but you would use the System.Windows.Forms.WebBrowser control to load the page. (Note that you do not have to host the control in a Form.) Once loaded, you have access to the page content through the Document property.

Your biggest issue will be in evaluating the page's content because there are the standard HTML elements and the Web Component's parameters. If you are interested in the parameters, then load the XMLData value into an XML Document and inspect with DOM.

Hopefully, this will get you started.