Using Design-Time Controls

By using Visual InterDev, you can create applications that easily use client database features. As we have seen in earlier chapters, all you need to do is move the scripting platform from the server side to the client side. Remember that this can be accomplished by right-clicking within the white space in your ASP Web page and choosing Properties from the context menu. You then set the DTC Scripting Platform to Client (IE 4.0 DHTML) in the General tab of the Properties dialog box. Changing the scripting platform for the page will change the scripting platform for all components on your page since by default they inherit their scripting platform from the page.

Figure 16-5 below shows the design-time control equivalent of the earlier TDC_Customer_List.htm example. This file is named DTC_Customer_List.asp. Instead of using a TDC, we are using the built-in client database features of Visual InterDev implemented behind the scenes using Remote Data Service.

The Search button performs a similar search to that applied in the TDC sample. In this case, it builds a SQL string and then uses it to requery the data source. The code for this section is as follows:

 Sub btnSearch_onclick()     If txtSearch.value = "" Then         str = "SELECT * FROM Customers"     Else         str = "SELECT * FROM Customers WHERE " + lstColumn.value + _             " LIKE '" + txtSearch.value + "'"     End If     MsgBox(str)     Recordset1.setSQLText(str)     Recordset1.requery() End Sub 

click to view at full size.

Figure 16-5. Internet Explorer 4.0 showing an ASP Web page that uses client database features.



Programming Microsoft Visual InterDev 6. 0
Programming Microsoft Visual InterDev 6.0
ISBN: 1572318147
EAN: 2147483647
Year: 2005
Pages: 143

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net