(Paper) Class XII Informatics Practices: Chapter Wise Papers (DATABASES AND ADO, OLE DB AND ODBC)

Disclaimer: This website is NOT associated with CBSE, for official website of CBSE visit - www.cbse.gov.in

Class XII Informatics Practices Paper (Chapter Wise With Answer)


DATABASES AND ADO, OLE DB AND ODBC

Q.1 What is a database ?
Ans.
A database is a persistent and centralized store for a set of logically related structured data.

Q.2 What is OLE DB?
Ans.
OLE DB (Object Linking & Embedding Databases), is a set of interfaces that provides uniform access to data stored in diverse data stores. Using OLE DB one can access all types of databases in the same manner.

Q.3 What is ADO ?
Ans.
ADO, Active X Data Objects, is an application program interface from Microsoft, Which is used with Windows Applications to get access to relational as well as non-relational databases.

Q.4 What is ODBC ?
Ans.
Open Data Base Connectivity(ODBC) is an application programming interface that enables application to access data form a variety of existing data sources.

Q.5 What are data bound controls.
Ans .
A data bound control is a control that can provide access to data stored in a database using proper datasource.

Q.6 Name some intrinsic and Active X data bound controls.

i)Intrinsic – TextBox, Label, ListBox, CheckBox
ii)ActiveX – DataGrid, DataList, MSFlexGrid.

Q.7 List any three methods of a connection object.
Ans.
Open method, Execute and Close method.

Q.8 Write command to create a connection string argument for connecting to a Oracle database, with user id as student and password as “school”.
Ans.
“Provider = MSDAORA ; User id= student ; password =school ;”

Q.9 What is a DSN ?
Ans.
The DSN (Data Source Name) is a logical name used by ODBC to store, the information required to access a data store.

Q.10 Which command type would you suggest as the data source for the following requirements.
(i)Entire table data is required.
(ii)A stored procedure is to executed.
(iii)SQL Command is to executed.
(iv)Source of data is unknown.
Ans. (i) adCmdTable.
(ii) adCmdStoredProc
(ii)adCmdText
(iii)adCmdUnknown

Q.11 What is the significance of locking a recordset ?
Ans.
In case of shared databases, multiple users may try to modified a data simultaneously, which will result in low database integrity. Hence in order to maintain database integrity a record must be locked for single user before modification.

Q.12 How ADO and OLE DB are linked together ?
Ans.
The OLE DB interfaces are implemented by an OLE DB provider, which in turn is used by ADO to provide a standard API to applications that use databases.


Q.13 Write VB statements to perform the following :
i)Move to the First record of recordset.
ii)Move to the previous record.
iii)Move to the next record when EOF is reached, move to the first record.
iv)Save the position of current record, i.e bookmark it.

Ans. (i) ADO.Recordset.MoveFirst
(ii) ADO.Recordset.MovePrevious
(iii)ADO.Recordset.MoveNext
IF ADO.Recordset.EOF then
ADO.Recordset.MoveFirst
End If
(iv)Dim Bookmark1 AS string
Bookmark1 =ADO.Recordset.BookMark

Q.14 Discuss briefly ADO object model.
Ans.
The ADO object model provides a set of objects to enable client application to access data stored in a database server through an OLE DB provider. The major components of this model include the Connection, Command, ResultSet and Field objects. ADO model also supports various other objects like Fields, Error, Parameter etc. To facilitate interaction with the major components. With ADO object model the control lies with the programmer as the programmer can set up and change properties of various objects as per requirements of the situation.

Q.15 Write code to update records of all those employees that have not been assigned department as yet. Assign dept number 10 to all of them. Use ADO DB.
Ans.
Private Sub Assign ( )
Dim cnnEmp As ADODB.Connection
Set cnnEmp = New ADODB.Connection
CnnEmp.CursorLocation = adUseClient
CnnEmp.Open “Provider =MSDAORA;User id=scott;password=tiger;”
CnnEmp.Execute “UPDATE emp SET deptno =10 WHERE deptno IS
NULL”
End Sub