Multiple choice asp ado

Which connection method requires a connection string?

  1. DSN

  2. DSN-less

  3. Both

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Both DSN and DSN-less connection methods require a connection string. DSN-based connections use a connection string that references a preconfigured Data Source Name, while DSN-less connections embed all connection parameters directly in the connection string itself. The connection string is essential in both approaches to specify database location, credentials, and driver information.

AI explanation

'Both' is correct. A DSN-less connection clearly needs a full connection string since there's no saved DSN entry to reference — the driver, server, database, and credentials must all be specified inline. But even a DSN-based connection is technically opened via a connection string (e.g., 'DSN=MyDataSource;UID=...;PWD=...'); the DSN just lets that string be shorter because most parameters are pre-configured in the ODBC Data Source Administrator. Since both methods ultimately pass a connection string to establish the connection, 'Both' captures that neither method bypasses it entirely.