Tag: ado

Questions Related to ado

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("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

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.

  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