Visual Basic (VB) Question:

What are the ADO objects?

Tweet Share WhatsApp

Answer:

Provide a scenario using three of them to return data from a database. Expected answer: Connection Connects to a data source; contains the Errors collectionCommand Executes commands to the data source. Is the only object that can accept parameters for a stored procedure.Recordset The set of data returned from the database.Scenario: There are many possibilities. The most likely is as follows:Dim conn As ADODB.ConnectionDim rs As ADODB.RecordsetDim Cmd As ADODB.Commandconn.ConnectionString = ?CONNECTION STRING?conn.OpenSet Cmd.ActiveConnection = connCmd.CommandText = ?SQL STATEMENT?Set rs = Cmd.ExecuteSet rs.ActiveConnection = Nothingconn.Close

Download Visual Basic (VB) PDF Read All 102 Visual Basic (VB) Questions
Previous QuestionNext Question
Describe Database Connection pooling (relative to MTS )?Under the ADO Command Object, what collection is responsible for input to stored procedures?