Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what are the Advantages of disconnected recordsets

Answer Posted / guest

A disconnected Recordset, as its name implies, is a
Recordset that lacks a connection. This may seem a bit
confusing at first - how can a Recordset lack a connection
to a data store?
- but will hopefully become more clear as the article
progresses.

seen that a Recordset that does not have a database
connection can be very useful as a tool in your
programming. It can save you time and effort and make your
code more scalable.

In order to create a disconnected Recordset two Recordset
properties must be set appropriately.It is a requirement
that the CursorLocation property is set to adUseClient and
the LockType property is set to adLockBatchOptimistic. Note
that the CursorType will default to adUseStatic
if we don't explicitly state that it should be set to
adUseClient.) i.e

rst.LockType = adLockBatchOptimistic
rst.CursorLocation = adUseClient

However, we've recently discovered that these steps aren't
necessary. VB automatically assigns batch optimistic
locking to newly created, connectionless recordsets. And,
of course, without a connection, a recordset can't have any
other cursor but a client-side one. To create one of these
structures, then, the only thing you need do is create the
object variable instance. After that, you can simply begin
adding fields to the construct.

To add fields, you use the Fields collection's Append
method. This method requires two parameters
, the field name and the field data type. So, to create a
connectionless recordset with two fields,you'd use code
similar to:

Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset

rst.Fields.Append "CustID", adVarChar
rst.Fields.Append "CustName", adVarChar

Additional, optional Append method parameters include
DefinedSize and Attrib. The DefinedSize
argument takes the size of the field. Fill the Attrib
parameter with constants that define additional field
characteristics, such as whether it will allow null values
or is updatable.
Since, in our technique, we want the fields to mirror the
structure of the original recordset, we'll simply use
existing values for these parameters.

Disconnected Recordsets, first available with ADO 2.0, are
the most commonly used mechanism to retrieve a Recordset
and open a connection for only the necessary amount of
time, thus increasing scalability. They are call
disconnected because the connection to the database is
closed.
The collections, properties, and methods of a disconnected
Recordset are still available even though the connection is
closed. This frees up server resources, given that the
number of open connections is limited and database locking
is a non-issue.

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

___ VB constant make the menu item in centre.

1781


What is meant by Establish Connection in RDO?

2162


What is the use of debug Window?

2053


Draw Sequence Modal of RDO and Explain?

2353


Types of ActiveX Components in VB?

1902


How do you change the icon and otherwise manipulate the DOS box?

1502


What is file in vb?

891


What is DBSqlPassThrough?

3246


____ is the difference between Listindex and Tab index.

1936


What is the use of Tabledef?

2030


how to use unicode data in vb6 regarding to telugu language, my output is in only telugu language

3608


How can I access a record by record number?

1547


What is the use of Imagelist Controls ?

2123


What are the uses of List View Control?

1916


What is DDE?

2222