ADO ASP Quiz - 1

Description: ADO ASP Quiz - 1
Number of Questions: 8
Created by:
Tags: asp ado
Attempted 0/8 Correct 0 Score 0

What must your ASP code have if you are using the DSN-less method of connecting?

  1. Connection object

  2. Connection string

  3. Both


Correct Option: C

Which connection method is this code using?...Dim dbConn Set dbConn = Server.CreateObject("ADOBD.Connection") dbConn.Connectionstring = "DSN=Quiz; uid=login; pwd=password" dbConn.Open

  1. DSN

  2. DSN-less

  3. Neither - the code is wrong


Correct Option: C

Which connection method is this code using?.. Dim dbConn Set dbConn = Server.CreateObject("ADODB.Connection") dbConn.Connectionstring = "DSN=Quiz; uid=login; pwd=password" dbConn.Open

  1. DSN

  2. DSN-less

  3. Neither - the code is wrong


Correct Option: A

Which connection method is this code using?..Dim dbConn Set dbConn = Server.CreateObject("ADODB.Connection") dbConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _ "DBQ=C:\wwwroot\username\database.mdb" dbConn.open

  1. DSN

  2. DSN-less

  3. Both A and B

  4. Neither - the code is wrong


Correct Option: D

Which connection method is this code using?..Dim dbConn Set dbConn = Server.CreateObject("ADODB.Connection") dbConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _ "DBQ=C:\wwwroot\username\database.mdd" dbConn.Open

  1. DSN

  2. DSN-less

  3. Neither - the code is wrong


Correct Option: C

While it is important to properly open the connection to the database, it is equally important to close the connection. Leaving a connection open is the same as leaving your house with the door open...Dim dbConn Set dbConn = Server.CreateObject("ADODB.Con

  1. True

  2. False


Correct Option: B

AI Explanation

To answer this question, you need to understand the importance of closing a connection to a database.

Option A) True - This option is incorrect because it states that it is important to close the connection to the database, which is true. However, it also states that leaving a connection open is the same as leaving your house with the door open, which is not an accurate comparison. While leaving a connection open can have security implications and can lead to resource wastage, it is not exactly the same as leaving your house with the door open.

Option B) False - This option is correct because it states that leaving a connection open is not the same as leaving your house with the door open. While it is important to properly open the connection to the database, it is equally important to close the connection. Leaving a connection open can lead to security vulnerabilities and can consume resources unnecessarily.

The correct answer is B) False.

It is okay to have connections open to multiple Access databases

  1. True

  2. False


Correct Option: A

What is the sequential procedure in working with databases?

  1. Connection string, connection object, close connection string, close connection object

  2. Connection object, connection string, close connection string, close connection object

  3. Connection object, connection string, close connection object, close connection string


Correct Option: B
- Hide questions