848 850




Visual Basic 6 Black Book:Databases: Using DAO, RDO, And ADO
function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) { var end = document.cookie.indexOf (";", j); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(j, end)); } i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } var m1=''; var gifstr=GetCookie("UsrType"); if((gifstr!=0 ) && (gifstr!=null)) { m2=gifstr; } document.write(m1+m2+m3);            Keyword Title Author ISBN Publisher Imprint Brief Full  Advanced      Search  Search Tips Please Select ----------- Components Content Mgt Certification Databases Enterprise Mgt Fun/Games Groupware Hardware IBM Redbooks Intranet Dev Middleware Multimedia Networks OS Prod Apps Programming Security UI Web Services Webmaster Y2K ----------- New Titles ----------- Free Archive To access the contents, click the chapter and section titles. Visual Basic 6 Black Book (Publisher: The Coriolis Group) Author(s): Steven Holzner ISBN: 1576102831 Publication Date: 08/01/98 function isIE4() { return( navigator.appName.indexOf("Microsoft") != -1 && (navigator.appVersion.charAt(0)=='4') ); } function bookMarkit() { var url="http://www.itknowledge.com/PSUser/EWBookMarks.html?url="+window.location+"&isbn=0"; parent.location.href=url; //var win = window.open(url,"myitk"); //if(!isIE4()) // win.focus(); } Search this book:  














Previous
Table of Contents
Next




Note that Visual Basic also supports some additional data-bound controls to work with the ADO data control specifically, and those controls are covered in the following topic.

Let’s see an example. In the program in Figure 24.19, we’ve added a number of controls that we bind to a data control, Data1. The data control, in turn, is connected to the db.mdb database we created in the beginning of the chapter. When you move through the database with the data control, the data in each bound control is updated. The code for this example is located in the dbcontrols folder on this book’s accompanying CD-ROM.

Figure 24.19  An example program showing the use of bound controls.
The ADO Data-Bound Controls
There are three data-bound controls that are specially optimized for use with the ADO data control: DataGrid controls, DataCombo controls, and DataList controls (don’t confuse these controls with the non-ADO optimized data-bound controls like the DBCombo and DBList controls). These controls are specifically designed to work with ADO data controls and won’t work with standard controls like the data control.

To add these controls to a program, follow these steps:

1.  Select the Project|Components menu item.
2.  Click the Controls tab in the Components dialog box that opens.
3.  Select both the Microsoft DataGrid Control entry and the Microsoft DataList Controls entry in the Controls list box.
4.  Click on OK to close the Components dialog box.
5.  This adds the DataGrid, DataCombo, and DataList control tools to the toolbox; draw those controls as you want them on your form.

Here are the principal data properties you use with these three controls:


•  DataGrid—DataSource = ADO data control’s name. You can also set the AllowAddNew, AllowDelete, AllowUpdate properties to True or False to enable or disable those operations.
•  DataCombo—DataSource = ADO data control’s name; DataField = Name of the field to display in the combo’s text box; ListField = Name of field to display in the list; RowSource = ADO data control’s name; and BoundColumn = Name of the source field with which you can provide data to another control.
•  DataList—DataSource = ADO data control’s name; DataField = Name of the field to display in the current selection, ListField = Name of field to display in the list, RowSource = ADO data control’s name, BoundColumn = Name of the source field with which you can provide data to another control.

Let’s see an example. In this case, we’ve added an ADO data control and the three ADO data-bound controls to a program, as shown in Figure 24.20, and connected them to the ADO data control using their various properties. That’s all it takes, and we’re in business. The code for this example is located in the dbcontrols2 folder on this book’s accompanying CD-ROM.


Figure 24.20  Using the ADO bound controls.



Previous
Table of Contents
Next






Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.



Wyszukiwarka

Podobne podstrony:
demo cgi 850
Kyocera FS 850 Parts Manual
VOLVO 850 1993
Tektronix Phaser 850 Cleaning Instructions
Cin Acr 850 SX [WF] L592 85
Cin Acr 850 SX L315 85
Cin Acr 850 SX L315 85m
Cin Acr 850 SX (DSM) L481 85m
Cin Acr 850 SX [WT] L381 85 3
Cin Acr 850 SX [STM] L437 85 10
Cin Acr 850 SX [D&H] L602 85
demo cgi 848
Cin Acr 850 [FMI] M814 87
Cin Acr 850 SX R [MOP] L675 85
Cin Acr 850 SX [WSR] L583 85 1
Cin Acr 850 SX [AG] L590 85 8

więcej podobnych podstron