While creating a Data Source connection in Cognos, there might be multiple errors that we might be faced with.  Below are few ones that I encountered:

QE-DEF-0285 Logon failure.
QE-DEF-0323 The DSN(ODBC)/serviceName is invalid. Either the DSN is missing or the host is inaccessible.
QE-DEF-0068 Unable to connect to at least one database during a multi-database attach to 1 database(s) in: testdatasourceconnection 

UDA-SQL-0031 unable to access the 'testdatasourceconnection' database
UDA-SQL-0532 Data Source is not accessible:<name>


I was trying to connect to DB2 database from Cognos, and both of them resided on different servers.   The DB2 client was installed on Cognos Server, so that it could connect to the DB2 server.  There was ODBC DSN created in Cognos Server. 

There are multiple posts on the net that give various solutions to fix the above error.  However, none of them fixed my issue.  Later, I found that the DB2 ODBC driver that was installed on Cognos Server was a 32 bit ODBC driver.  The operating system on which it was installed was Windows Server 2008 R2 64 bit.  

In such a case, we SHOULD NOT use START --> PROGRAMS --> ADMINISTRATIVE TOOLS --> DATA SOURCES to create the ODBC DSN as it points to c:\windows\system32\odbcad32.exe.

To manage a data source that connects to a 32-bit driver under 64-bit platform, use c:\windows\sysWOW64\odbcad32.exe. To manage a data source that connects to a 64-bit driver, use c:\windows\system32\odbcad32.exe. 

If you use the 64-bit odbcad32.exe to configure or remove a DSN that connects to a 32-bit driver, you will receive the following error message:
The specified DSN contains an architecture mismatch between the Driver and Application