Podstrony
- Strona startowa
- Richard Dawkins Bog urojony
- Cortazar Julio Gra w klasy (3)
- Makuszynski Kornel Awantury arabskie (SCAN dal 937
- Jacquemard Serge Requiem dla krola zbrodni
- Rice, Anne Lestat 'Opowiesc o zlodzieju cial'
- Andrzej Sapkowski Narrenturm
- Aronson Elliot Psychologia spoleczna Serce i umysl
- Jordan Robert Czara Wiatrow (SCAN dal 963)
- Sandemo Margit Saga o Czarnoksiazniku Tom 1
- Long Julie Anne Siostry Holt 02 Urocza i nieznoÂśna
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- dacia.pev.pl
[ Pobierz całość w formacie PDF ]
.In TADOStoredProc,NextRecordset returns an interface that can be assigned to the RecordSet property of anexisting ADO dataset.For either class, the method returns the number of records inthe returned dataset as an output parameter.The first time you call NextRecordSet, it returns the second set of records.CallingNextRecordSet again returns a third dataset, and so on, until there are no more sets ofrecords.When there are no additional cursors, NextRecordSet returns nil.Under st andi ng dat aset s 18-5318-54 Dev el oper s Gui deCh a p t e r19Chapter 19Working with field componentsThis chapter describes the properties, events, and methods common to the TFieldobject and its descendants.Field components represent individual fields (columns) indatasets.This chapter also describes how to use field components to control thedisplay and editing of data in your applications.Field components are always associated with a dataset.You never use a TField objectdirectly in your applications.Instead, each field component in your application is aTField descendant specific to the datatype of a column in a dataset.Field componentsprovide data-aware controls such as TDBEdit and TDBGrid access to the data in aparticular column of the associated dataset.Generally speaking, a single field component represents the characteristics of a singlecolumn, or field, in a dataset, such as its data type and size.It also represents thefield s display characteristics, such as alignment, display format, and edit format.Forexample, a TFloatField component has four properties that directly affect theappearance of its data:Table 19.1 TFloatField properties that affect data displayProperty PurposeAlignment Specifies whether data is displayed left-aligned, centered, or right-aligned.DisplayWidth Specifies the number of digits to display in a control at one time.DisplayFormat Specifies data formatting for display (such as how many decimal places to show).EditFormat Specifies how to display a value during editing.As you scroll from record to record in a dataset, a field component lets you view andchange the value for that field in the current record.Field components have many properties in common with one another (such asDisplayWidth and Alignment), and they have properties specific to their data types(such as Precision for TFloatField).Each of these properties affect how data appears toan application s users on a form.Some properties, such as Precision, can also affectwhat data values the user can enter in a control when modifying or entering data.Wor ki ng wi t h f i el d component s 19-1Dy n a mi c f i e l d c o mp o n e n t sAll field components for a dataset are either dynamic (automatically generated foryou based on the underlying structure of database tables), or persistent (generatedbased on specific field names and properties you set in the Fields editor).Dynamicand persistent fields have different strengths and are appropriate for different typesof applications.The following sections describe dynamic and persistent fields inmore detail and offer advice on choosing between them.Dynamic field componentsDynamically generated field components are the default.In fact, all field componentsfor any dataset start out as dynamic fields the first time you place a dataset on a datamodule, specify how that dataset fetches its data, and open it.A field component isdynamic if it is created automatically based on the underlying physical characteristicsof the data represented by a dataset.Datasets generate one field component for eachcolumn in the underlying data.The exact TField descendant created for each columnis determined by field type information received from the database or (forTClientDataSet) from a provider component.Dynamic fields are temporary.They exist only as long as a dataset is open.Each timeyou reopen a dataset that uses dynamic fields, it rebuilds a completely new set ofdynamic field components based on the current structure of the data underlying thedataset.If the columns in the underlying data change, then the next time you open adataset that uses dynamic field components, the automatically generated fieldcomponents are also changed to match.Use dynamic fields in applications that must be flexible about data display andediting.For example, to create a database browsing tool such as SQL explorer, youmust use dynamic fields because every database table has different numbers andtypes of columns.You might also want to use dynamic fields in applications whereuser interaction with data mostly takes place inside grid components and you knowthat the datasets used by the application change frequently.To use dynamic fields in an application:1 Place datasets and data sources in a data module.2 Associate the datasets with data.This involves using a connection component orprovider to connect to the source of the data and setting any properties thatspecify what data the dataset represents.3 Associate the data sources with the datasets.4 Place data-aware controls in the application s forms, add the data module to eachuses clause for each form s unit, and associate each data-aware control with a datasource in the module.In addition, associate a field with each data-aware controlthat requires one.Note that because you are using dynamic field components,there is no guarantee that any field name you specify will exist when the dataset isopened.5 Open the datasets.19-2 Devel oper s Gui dePe r s i s t e n t f i e l d c o mp o n e n t sAside from ease of use, dynamic fields can be limiting
[ Pobierz całość w formacie PDF ]