MDAC SDK OSP Sample : Binding in HTML

MDAC SDK OSP Sample : Binding in HTML

Post by SmFtZXMgQC » Thu, 23 Mar 2006 05:51:29


I am looking to integrate the Simple Data Provider into my application that
hosts the webrowser control. However, I can't seem to make the sample
provided with the MDAC SDK work using the standard HTML data bind mechanism.

The sample I am referring to is in the MDAC SDK under:
"%SYSTEMDRIVE%\Microsoft Data Access SDK 2.8\Samples\osp\vc\"

It is advertised as compatible with iexplorer data binding here:
http://www.yqcomputer.com/
url=/workshop/database/databind/simpletabulardata.asp

Unfortunately, it comes with no test application (really strange for a dll
sample).

I can use VBScript to populate a table using this sample:

<!-- VBScript Sample Tester (WORKS) -->
<TABLE ID="tblScript" BORDER="1"/>
</TABLE>
</BODY>
<SCRIPT LANGUAGE="VBScript">
Dim con
Set con = CreateObject("ADODB.Connection")
Dim rs
Set rs = CreateObject("ADODB.RecordSet")
con.Provider = "MSDAOSP"
con.Properties("Data Source") = "ospsampc"
con.Open
rs.Open "D:\DEV\_TOOLS\osp\customer.txt", con
if rs.Fields.Count>0 Then
Dim rCell
Dim rRow
Set rRow = tblScript.insertRow( )
For Each Col in rs.Fields
Set rCell = rRow.insertCell()
rCell.innerText = Col.Name
Next
while( rs.EOF<>True )
Set rRow = tblScript.insertRow()
For Each Col in rs.Fields
Set rCell = rRow.insertCell()
rCell.innerText = Col.Value
Next
rs.MoveNext()
Wend
End If
</SCRIPT>

When I do so, it queries for the following interfaces:
{00000000-0000-0000-C000-000000000046} IUnknown
{7C0FFAB3-CD84-11D0-949A-00A0C91110ED} IID_DataSource

But, I CANNOT get HTML data binding to work. Here is the code:

<!-- HTML Sample Tester (DOESN'T WORK) -->
<OBJECT ID="dsoCustom" CLASSID="clsid:1E79B2C1-077B-11d1-B3AE-00AA00C1A924">
</OBJECT>
<TABLE ID="tblBind" DATASRC="#dsoCustom" BORDER="1" >
<TR>
<TD><DIV DATAFLD="CustomerID"/></TD>
<TD><DIV DATAFLD="CompanyName"/></TD>
</TR>
</TABLE>

When I do so, iexplorer never queries for the DataSource interface (like
with the script). Instead, it queries for the following interfaces:

{00000000-0000-0000-C000-000000000046} IUnknown
{CF51ED10-62FE-11CF-BF86-00A0C9034836} IID_IQuickActivate
{22F55881-280B-11D0-A8A9-00A0C90C2004} IID_IPersistPropertyBag2
{37D84F60-42CB-11CE-8135-00AA004BB851} IID_IPersistPropertyBag
{7FD52380-4E07-101B-AE2D-08002B2EC713} IID_IPersistStreamInit
{3AF24292-0C96-11CE-A0CF-00AA00600AB8} IID_IViewObjectEx
{FC4801A3-2BA9-11CF-A229-00AA003D7352} IID_IObjectWithSite
{B196B284-BAB4-101A-B69C-00AA00341D07} IID_IConnectionPointContainer
{BB1A2AE1-A4F9-11CF-8F20-00805F2CD064} IID_IActiveScript
{6D5140D3-7436-11CE-8034-00AA006009FA} ???
{B196B288-BAB4-101A-B69C-00AA00341D07} ???
{B722BCCB-4E68-101B-A2BC-00AA00404770} IID_IOleCommandTarget
{A6EF9860-C720-11D0-9337-00A0C90DCAA9} IID_IDispatchEx
{B196B288-BAB4-101A-B69C-00AA00341D07} IID_IOleControl
{B196B288-BAB4-101A-B69C-00AA00341D07} IID_IOleControl

What am I doing wrong? How do I make this work (what do I implement)?

James A. Renton
Castel, Inc.
Beverly, MA.