Vous êtes sur la page 1sur 11

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : Y.Vijaya Bhaskara Reddy
Designation : Senior Lecturer
Branch : Commercial and Computer Practice
Institute : VI semester
Subject : Visual Basics—II
Subject code : CCP-603.
Topic : data base Programming
Duration : 50 minutes
Sub topic : know how to access fields In
recordsets
Teaching Aids : PPTs
CCP603.24C 1
OBJECTIVES

On completion of this period, you would be


able to:
 Know how to access fields in Recordsets

CCP603.24C 2
Structure Of The Period:
 Example for Table-type Recordset

 Example for Dynaset-type Recordset

 Example for Snapshot-type Recordset

CCP603.24C 3
Recap:

 Characteristics of Table-type Recordset

 Characteristics of Dynaset-type Recordset


 Characteristics of Snapshot-type Recordset

CCP603.24C 4
Table-Type Recordset Example:
This example opens a table-type Recordset:
Sub dbOpenTableX()
Dim dbsNorthwind As Database
Dim rstEmployees As Recordset
Set dbsNorthwind = OpenDatabase("Northwind.mdb")
' dbOpenTable is default.
Set rstEmployees =dbsNorthwind.OpenRecordset("Employees")
End Sub

CCP603.24C 5
Dynaset-Type Recordset Example:
This example opens a Dynaset-type Recordset.
Sub dbOpenTableX()
Dim dbsNorthwind As Database
Dim rstEmployees As Recordset
Set dbsNorthwind = OpenDatabase("Northwind.mdb")
Set rstEmployees = dbsNorthwind.OpenRecordset(“Invoices“,
dbOpenDynaset)
End Sub

CCP603.24C 6
Snapshot-Type Recordset Example:
This example opens a Snapshot-type Recordset.

Sub dbOpenTableX()
Dim dbsNorthwind As Database
Dim rstEmployees As Recordset
Set dbsNorthwind = OpenDatabase("Northwind.mdb")
Set rstEmployees = dbsNorthwind.OpenRecordset(“Employees“,
dbOpenSnapshot)
End Sub

CCP603.24C 7
Quiz

1.To open a static set of records, what type of


Recordset is used ?
Ans: Snapshot-type.
2.What is the recordset based on a table ?
Ans: Table-type.

CCP603.24C 8
Frequently Asked Questions:

1. Briefly explain Table-type recordset with an


example.

2. Briefly explain Dynaset-type recordset with an


example.

CCP603.24C 9
Summary:

 Example for Table-type recordset


 Example for Dynaset-type recordset
 Example for Snapshot-type recordset

CCP603.24C 10
Assignment

3. Briefly explain Snapshot-type recordset with an


example.

CCP603.24C 11

Vous aimerez peut-être aussi