ASP Database Connection Methods with ADO
Test your knowledge of ADO database connection methods in ASP, including DSN vs DSN-less connections, connection management best practices, and sequential database operation procedures.
Questions
What must your ASP code have if you are using the DSN-less method of connecting?
- Connection object
- Connection string
- Both
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
- DSN
- DSN-less
- Neither - the code is wrong
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
- DSN
- DSN-less
- Neither - the code is wrong
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
- DSN
- DSN-less
- Both A and B
- Neither - the code is wrong
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
- DSN
- DSN-less
- Neither - the code is wrong
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
- True
- False
It is okay to have connections open to multiple Access databases
- True
- False
What is the sequential procedure in working with databases?
- Connection string, connection object, close connection string, close connection object
- Connection object, connection string, close connection string, close connection object
- Connection object, connection string, close connection object, close connection string