SlideShare a Scribd company logo
1 of 19
ADO OBJECT
ADO OBJECT
 ADO is a Microsoft technology
 ADO stands for ActiveX Data Objects
 ADO is a Microsoft Active-X component
 ADO is automatically installed with Microsoft IIS
 ADO is a programming interface to access data in a
database
LIST OF ADO OBJECTS
 ADO Command Object
 ADO Connection Object
 ADO Recordset Object
ADO COMMAND OBJECT
 The ADO Command object is used to execute a single
query against a database. The query can perform
actions like creating, adding, retrieving, deleting or
updating records.
 If the query is used to retrieve data, the data will be
returned as a RecordSet object. This means that the
retrieved data can be manipulated by properties,
collections, methods, and events of the Recordset
object.
 The major feature of the Command object is the ability
to use stored queries and procedures with parameters.
 ProgID
 set
objCommand=Server.CreateObject("ADODB.comma
nd")
Property Description
ActiveConnection Sets or returns a definition for a connection if
the connection is closed, or the current
Connection object if the connection is open
CommandText Sets or returns a provider command
CommandTimeout Sets or returns the number of seconds to wait
while attempting to execute a command
CommandType Sets or returns the type of a Command object
Name Sets or returns the name of a Command object
Prepared Sets or returns a Boolean value that, if set to
True, indicates that the command should save
a prepared version of the query before the first
execution
State Returns a value that describes if the
Command object is open, closed, connecting,
executing or retrieving data
METHODS
Method Description
Cancel Cancels an execution of a method
CreateParameter Creates a new Parameter object
Execute Executes the query, SQL statement
or procedure in the CommandText
property
COLLECTIONS
Collection Description
Parameters Contains all the Parameter objects
of a Command Object
Properties Contains all the Property objects of
a Command Object
ADO CONNECTION OBJECT
 The ADO Connection Object is used to create an
open connection to a data source. Through this
connection, you can access and manipulate a
database.
 If you want to access a database multiple times,
you should establish a connection using the
Connection object. You can also make a connection
to a database by passing a connection string via a
Command or Recordset object. However, this type
of connection is only good for one specific, single
query.
 ProgID
 set objConnection=Server.CreateObject("ADODB.connection")
PROPERTIES
Property Description
Attributes Sets or returns the attributes of a Connection
object
CommandTimeout Sets or returns the number of seconds to wait
while attempting to execute a command
ConnectionString Sets or returns the details used to create a
connection to a data source
ConnectionTimeout Sets or returns the number of seconds to wait for
a connection to open
CursorLocation Sets or returns the location of the cursor service
DefaultDatabase Sets or returns the default database name
IsolationLevel Sets or returns the isolation level
Mode Sets or returns the provider access permission
Provider Sets or returns the provider name
State Returns a value describing if the connection is
open or closed
Version Returns the ADO version number
METHODS
Method Description
BeginTrans Begins a new transaction
Cancel Cancels an execution
Close Closes a connection
CommitTrans Saves any changes and ends the
current transaction
Execute Executes a query, statement,
procedure or provider specific text
Open Opens a connection
OpenSchema Returns schema information from
the provider about the data source
RollbackTrans Cancels any changes in the current
transaction and ends the
transaction
EVENTS
Event Description
BeginTransComplete Triggered after the BeginTrans
operation
CommitTransComplete Triggered after the CommitTrans
operation
ConnectComplete Triggered after a connection starts
Disconnect Triggered after a connection ends
ExecuteComplete Triggered after a command has
finished executing
InfoMessage Triggered if a warning occurs during a
ConnectionEvent operation
RollbackTransComplete Triggered after the RollbackTrans
operation
WillConnect Triggered before a connection starts
WillExecute Triggered before a command is
executed
COLLECTIONS
Collection Description
Errors Contains all the Error objects of the
Connection object
Properties Contains all the Property objects of
the Connection object
ADO RECORDSET OBJECT
 The ADO Recordset object is used to hold a set of records
from a database table. A Recordset object consist of
records and columns (fields).
 In ADO, this object is the most important and the one used
most often to manipulate data from a database.
 ProgID
 set
objRecordset=Server.CreateObject("ADODB.recordset")
CONTINUES..
 When you first open a Recordset, the current
record pointer will point to the first record and the
BOF and EOF properties are False. If there are no
records, the BOF and EOF property are True.
 Recordset objects can support two types of
updating:
 Immediate updating - all changes are written
immediately to the database once you call the Update
method.
 Batch updating - the provider will cache multiple
changes and then send them to the database with the
UpdateBatch method.
CONTINUES..
 In ADO there are 4 different cursor types defined:
 Dynamic cursor - Allows you to see additions, changes, and
deletions by other users.
 Keyset cursor - Like a dynamic cursor, except that you
cannot see additions by other users, and it prevents access to
records that other users have deleted. Data changes by other
users will still be visible.
 Static cursor - Provides a static copy of a recordset for you
to use to find data or generate reports. Additions, changes, or
deletions by other users will not be visible. This is the only
type of cursor allowed when you open a client-side Recordset
object.
 Forward-only cursor - Allows you to only scroll forward
through the Recordset. Additions, changes, or deletions by
other users will not be visible.
PROPERTIES
Property Description
AbsolutePage Sets or returns a value that specifies the
page number in the Recordset object
AbsolutePosition Sets or returns a value that specifies the
ordinal position of the current record in the
Recordset object
ActiveCommand Returns the Command object associated with
the Recordset
ActiveConnection Sets or returns a definition for a connection if
the connection is closed, or the current
Connection object if the connection is open
BOF Returns true if the current record position is
before the first record, otherwise false
Bookmark Sets or returns a bookmark. The bookmark
saves the position of the current record
METHODS
Method Description
AddNew Creates a new record
Cancel Cancels an execution
CancelBatch Cancels a batch update
CancelUpdate Cancels changes made to a record
of a Recordset object
Clone Creates a duplicate of an existing
Recordset
Close Closes a Recordset
CompareBookmarks Compares two bookmarks
Delete Deletes a record or a group of
records
EVENTS
Event Description
EndOfRecordset Triggered when you try to move to a record after the
last record
FetchComplete Triggered after all records in an asynchronous
operation have been fetched
FetchProgress Triggered periodically in an asynchronous operation,
to state how many more records that have been
fetched
FieldChangeComplete Triggered after the value of a Field object change
MoveComplete Triggered after the current position in the Recordset
has changed
RecordChangeComplete Triggered after a record has changed
RecordsetChangeComplete Triggered after the Recordset has changed
COLLECTIONS
Collection Description
Fields Indicates the number of Field
objects in the Recordset object
Properties Contains all the Property objects in
the Recordset object

More Related Content

What's hot

Chapter 3: ado.net
Chapter 3: ado.netChapter 3: ado.net
Chapter 3: ado.netNgeam Soly
 
Ch06 ado.net fundamentals
Ch06 ado.net fundamentalsCh06 ado.net fundamentals
Ch06 ado.net fundamentalsMadhuri Kavade
 
Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...Shakir Majeed Khan
 
Share pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbsShare pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbsShakir Majeed Khan
 
Session06 handling xml data
Session06  handling xml dataSession06  handling xml data
Session06 handling xml datakendyhuu
 
Database connectivity to sql server asp.net
Database connectivity to sql server asp.netDatabase connectivity to sql server asp.net
Database connectivity to sql server asp.netHemant Sankhla
 
Disconnected Architecture and Crystal report in VB.NET
Disconnected Architecture and Crystal report in VB.NETDisconnected Architecture and Crystal report in VB.NET
Disconnected Architecture and Crystal report in VB.NETEverywhere
 
ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationRandy Connolly
 
Preethi apex-basics-jan19
Preethi apex-basics-jan19Preethi apex-basics-jan19
Preethi apex-basics-jan19Preethi Harris
 
Intro to React | DreamLab Academy
Intro to React | DreamLab AcademyIntro to React | DreamLab Academy
Intro to React | DreamLab AcademyDreamLab
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETFernando G. Guerrero
 
ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsRandy Connolly
 
Diving in the Flex Data Binding Waters
Diving in the Flex Data Binding WatersDiving in the Flex Data Binding Waters
Diving in the Flex Data Binding Watersmichael.labriola
 

What's hot (20)

Chapter 3: ado.net
Chapter 3: ado.netChapter 3: ado.net
Chapter 3: ado.net
 
Ch06 ado.net fundamentals
Ch06 ado.net fundamentalsCh06 ado.net fundamentals
Ch06 ado.net fundamentals
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...
 
Ch 7 data binding
Ch 7 data bindingCh 7 data binding
Ch 7 data binding
 
Share pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbsShare pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbs
 
Ado.Net Tutorial
Ado.Net TutorialAdo.Net Tutorial
Ado.Net Tutorial
 
Ado.net
Ado.netAdo.net
Ado.net
 
5.C#
5.C#5.C#
5.C#
 
Session06 handling xml data
Session06  handling xml dataSession06  handling xml data
Session06 handling xml data
 
Database connectivity to sql server asp.net
Database connectivity to sql server asp.netDatabase connectivity to sql server asp.net
Database connectivity to sql server asp.net
 
Disconnected Architecture and Crystal report in VB.NET
Disconnected Architecture and Crystal report in VB.NETDisconnected Architecture and Crystal report in VB.NET
Disconnected Architecture and Crystal report in VB.NET
 
ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And Representation
 
Preethi apex-basics-jan19
Preethi apex-basics-jan19Preethi apex-basics-jan19
Preethi apex-basics-jan19
 
2310 b 09
2310 b 092310 b 09
2310 b 09
 
Intro to React | DreamLab Academy
Intro to React | DreamLab AcademyIntro to React | DreamLab Academy
Intro to React | DreamLab Academy
 
Dealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NETDealing with SQL Security from ADO.NET
Dealing with SQL Security from ADO.NET
 
ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server Controls
 
Diving in the Flex Data Binding Waters
Diving in the Flex Data Binding WatersDiving in the Flex Data Binding Waters
Diving in the Flex Data Binding Waters
 

Similar to Ado object

Similar to Ado object (20)

Data base connectivity and flex grid in vb
Data base connectivity and flex grid in vbData base connectivity and flex grid in vb
Data base connectivity and flex grid in vb
 
Introduction to ado
Introduction to adoIntroduction to ado
Introduction to ado
 
Ado.net
Ado.netAdo.net
Ado.net
 
Ado Net
Ado NetAdo Net
Ado Net
 
Ado.net
Ado.netAdo.net
Ado.net
 
jdbc_presentation.ppt
jdbc_presentation.pptjdbc_presentation.ppt
jdbc_presentation.ppt
 
Entity framework 4.0
Entity framework 4.0Entity framework 4.0
Entity framework 4.0
 
vishual basic data base Pankaj
vishual basic data base Pankajvishual basic data base Pankaj
vishual basic data base Pankaj
 
Ado
AdoAdo
Ado
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
 
Unit4
Unit4Unit4
Unit4
 
Csharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptxCsharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptx
 
Ado.net & data persistence frameworks
Ado.net & data persistence frameworksAdo.net & data persistence frameworks
Ado.net & data persistence frameworks
 
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
 
6 database
6 database 6 database
6 database
 
ADO .NET by Sonu Vishwakarma
ADO .NET by Sonu VishwakarmaADO .NET by Sonu Vishwakarma
ADO .NET by Sonu Vishwakarma
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
3. ADO.NET
3. ADO.NET3. ADO.NET
3. ADO.NET
 
Murach: How to transfer data from controllers
Murach: How to transfer data from controllersMurach: How to transfer data from controllers
Murach: How to transfer data from controllers
 
2310 b 10
2310 b 102310 b 10
2310 b 10
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 

Ado object

  • 2. ADO OBJECT  ADO is a Microsoft technology  ADO stands for ActiveX Data Objects  ADO is a Microsoft Active-X component  ADO is automatically installed with Microsoft IIS  ADO is a programming interface to access data in a database
  • 3. LIST OF ADO OBJECTS  ADO Command Object  ADO Connection Object  ADO Recordset Object
  • 4. ADO COMMAND OBJECT  The ADO Command object is used to execute a single query against a database. The query can perform actions like creating, adding, retrieving, deleting or updating records.  If the query is used to retrieve data, the data will be returned as a RecordSet object. This means that the retrieved data can be manipulated by properties, collections, methods, and events of the Recordset object.  The major feature of the Command object is the ability to use stored queries and procedures with parameters.  ProgID  set objCommand=Server.CreateObject("ADODB.comma nd")
  • 5. Property Description ActiveConnection Sets or returns a definition for a connection if the connection is closed, or the current Connection object if the connection is open CommandText Sets or returns a provider command CommandTimeout Sets or returns the number of seconds to wait while attempting to execute a command CommandType Sets or returns the type of a Command object Name Sets or returns the name of a Command object Prepared Sets or returns a Boolean value that, if set to True, indicates that the command should save a prepared version of the query before the first execution State Returns a value that describes if the Command object is open, closed, connecting, executing or retrieving data
  • 6. METHODS Method Description Cancel Cancels an execution of a method CreateParameter Creates a new Parameter object Execute Executes the query, SQL statement or procedure in the CommandText property
  • 7. COLLECTIONS Collection Description Parameters Contains all the Parameter objects of a Command Object Properties Contains all the Property objects of a Command Object
  • 8. ADO CONNECTION OBJECT  The ADO Connection Object is used to create an open connection to a data source. Through this connection, you can access and manipulate a database.  If you want to access a database multiple times, you should establish a connection using the Connection object. You can also make a connection to a database by passing a connection string via a Command or Recordset object. However, this type of connection is only good for one specific, single query.  ProgID  set objConnection=Server.CreateObject("ADODB.connection")
  • 9. PROPERTIES Property Description Attributes Sets or returns the attributes of a Connection object CommandTimeout Sets or returns the number of seconds to wait while attempting to execute a command ConnectionString Sets or returns the details used to create a connection to a data source ConnectionTimeout Sets or returns the number of seconds to wait for a connection to open CursorLocation Sets or returns the location of the cursor service DefaultDatabase Sets or returns the default database name IsolationLevel Sets or returns the isolation level Mode Sets or returns the provider access permission Provider Sets or returns the provider name State Returns a value describing if the connection is open or closed Version Returns the ADO version number
  • 10. METHODS Method Description BeginTrans Begins a new transaction Cancel Cancels an execution Close Closes a connection CommitTrans Saves any changes and ends the current transaction Execute Executes a query, statement, procedure or provider specific text Open Opens a connection OpenSchema Returns schema information from the provider about the data source RollbackTrans Cancels any changes in the current transaction and ends the transaction
  • 11. EVENTS Event Description BeginTransComplete Triggered after the BeginTrans operation CommitTransComplete Triggered after the CommitTrans operation ConnectComplete Triggered after a connection starts Disconnect Triggered after a connection ends ExecuteComplete Triggered after a command has finished executing InfoMessage Triggered if a warning occurs during a ConnectionEvent operation RollbackTransComplete Triggered after the RollbackTrans operation WillConnect Triggered before a connection starts WillExecute Triggered before a command is executed
  • 12. COLLECTIONS Collection Description Errors Contains all the Error objects of the Connection object Properties Contains all the Property objects of the Connection object
  • 13. ADO RECORDSET OBJECT  The ADO Recordset object is used to hold a set of records from a database table. A Recordset object consist of records and columns (fields).  In ADO, this object is the most important and the one used most often to manipulate data from a database.  ProgID  set objRecordset=Server.CreateObject("ADODB.recordset")
  • 14. CONTINUES..  When you first open a Recordset, the current record pointer will point to the first record and the BOF and EOF properties are False. If there are no records, the BOF and EOF property are True.  Recordset objects can support two types of updating:  Immediate updating - all changes are written immediately to the database once you call the Update method.  Batch updating - the provider will cache multiple changes and then send them to the database with the UpdateBatch method.
  • 15. CONTINUES..  In ADO there are 4 different cursor types defined:  Dynamic cursor - Allows you to see additions, changes, and deletions by other users.  Keyset cursor - Like a dynamic cursor, except that you cannot see additions by other users, and it prevents access to records that other users have deleted. Data changes by other users will still be visible.  Static cursor - Provides a static copy of a recordset for you to use to find data or generate reports. Additions, changes, or deletions by other users will not be visible. This is the only type of cursor allowed when you open a client-side Recordset object.  Forward-only cursor - Allows you to only scroll forward through the Recordset. Additions, changes, or deletions by other users will not be visible.
  • 16. PROPERTIES Property Description AbsolutePage Sets or returns a value that specifies the page number in the Recordset object AbsolutePosition Sets or returns a value that specifies the ordinal position of the current record in the Recordset object ActiveCommand Returns the Command object associated with the Recordset ActiveConnection Sets or returns a definition for a connection if the connection is closed, or the current Connection object if the connection is open BOF Returns true if the current record position is before the first record, otherwise false Bookmark Sets or returns a bookmark. The bookmark saves the position of the current record
  • 17. METHODS Method Description AddNew Creates a new record Cancel Cancels an execution CancelBatch Cancels a batch update CancelUpdate Cancels changes made to a record of a Recordset object Clone Creates a duplicate of an existing Recordset Close Closes a Recordset CompareBookmarks Compares two bookmarks Delete Deletes a record or a group of records
  • 18. EVENTS Event Description EndOfRecordset Triggered when you try to move to a record after the last record FetchComplete Triggered after all records in an asynchronous operation have been fetched FetchProgress Triggered periodically in an asynchronous operation, to state how many more records that have been fetched FieldChangeComplete Triggered after the value of a Field object change MoveComplete Triggered after the current position in the Recordset has changed RecordChangeComplete Triggered after a record has changed RecordsetChangeComplete Triggered after the Recordset has changed
  • 19. COLLECTIONS Collection Description Fields Indicates the number of Field objects in the Recordset object Properties Contains all the Property objects in the Recordset object