845 847




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




Updating A Database With Changes
After changing the fields in a record, you can update a database with the UpdateRecord method of the data, ADO data control, or remote data control. Let’s see an example. When the user clicks the Update button in the dbmethods example we’re developing in this and the previous few topics, we can update the database with the new record like this:


Private Sub cmdUpdate_Click()
Data1.UpdateRecord
End Sub


Moving To The Next Record
You can move to the next record of a database with the MoveNext method of the Recordset property of a data or ADO data control, or of the Resultset property of a remote data control. Let’s see an example. When the user clicks the Next button in the dbmethods example we’re developing in this and the previous few topics, we can move to the next record like this:


Private Sub cmdNext_Click()
Data1.Recordset.MoveNext
End Sub



TIP:  You can use the RecordCount property of a Recordset or Resultset to determine how many records you have to work with, and so make sure you don’t go past the end of the database.

Moving To The Previous Record
You can move to the previous record of a database with the MovePrevious method of the Recordset property of a data or ADO data control, or of the Resultset property of a remote data control. Let’s see an example. When the user clicks the Previous button in the dbmethods example we’re developing in this and the previous few topics, we can move to the previous record like this:


Private Sub cmdPrevious_Click()
Data1.Recordset.MovePrevious
End Sub



TIP:  When you use MovePrevious, make sure you don’t try to move back before the first record of the database.

Moving To The First Record
You can move to the first record of a database with the MoveFirst method of the Recordset property of a data or ADO data control, or of the Resultset property of a remote data control. Let’s see an example. When the user clicks the First button in the dbmethods example we’re developing in this and the previous few topics, we can move to the first record like this:


Private Sub cmdFirst_Click()
Data1.Recordset.MoveFirst
End Sub


Moving To The Last Record
You can move to the last record of a database with the MoveLast method of the Recordset property of a data or ADO data control, or of the Resultset property of a remote data control. Let’s see an example. When the user clicks the Last button in the dbmethods example we’re developing in this and the previous few topics, we can move to the last record like this:


Private Sub cmdLast_Click()
Data1.Recordset.MoveLast
End Sub


The Data-Bound Controls: From Text Boxes To Flex Grids
After installing a data, remote data, or ADO data control, you can connect that control to other controls through a process called data binding. You bind controls to a data control using the data properties of the bound control. The standard bound controls and their data properties appear in Table 24.1. Using the information in that table, you can connect the listed Visual Basic controls to data controls, remote data controls, and ADO data controls.
Table 24.1 The bound controls.
Control
Properties To Set

Checkbox
DataField = Desired Boolean field; DataSource = Data control’s name

Combo box
DataField = Desired field; DataSource = Data control’s name

DBCombo box
BoundColumn = Desired field; DataField = Desired field; DataSource = Data control’s name; ListField = Desired field to display in the combo’s list; RowSource = Data control’s name

DBList box
DataField = Desired field; DataSource = Data control’s name; RowSource = Data control’s name

FlexGrid
DataSource = Data control’s name

Image control
DataField = Desired field; DataSource = Data control’s name

Label
DataField = Desired field; DataSource = Data control’s name

List box
DataField = Desired field; DataSource = Data control’s name

MaskedEdit
DataField = Desired field; DataSource = Data control’s name

MSFlexFrid
DataSource = Data control’s name

Picture box
DataField = Desired field; DataSource = Data control’s name

Text box
DataField = Desired field; DataSource = Data control’s name

Rich text box
DataField = Desired field; DataSource = Data control’s name





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 847
Compost Soil 847 1538 1 PB
mbdch20 847
810 845
847 (2)
META 845
Golec uOrkiestra Kochom ciebie dziewczyno (845)
LCD TV 84 Aper TV 845 1
mbdch20 845
LCD TV 84 Aper TV 845
META 845

więcej podobnych podstron