
Hi all,
i am trying to develop a new SSRS report usign RDP class and data get from external database odbc connection.
when run a report i getting below error:
Error 1
An exception occurred in the query metadata execution. The exception is ODBC operation failed.
Unable to log on to the database.
[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
Object 'OdbcConnection' could not be created. Dar_RFQCompReport.CopyOfRFQCompare [Preview] 0 0
*This post is locked for comments
I have the same question (0)Error clearly indicates that your connection is not successful with database.
Please check the following link: msdn.microsoft.com/.../ms712362(v=vs.85).aspx
The following code may help you:
//Database connection classes
OdbcConnection odbcConnection;
LoginProperty loginProperty;
SysSQLSystemInfo systemInfo;
// Database result fetching
Statement statement;
//Initializtion
loginProperty = new LoginProperty();
systemInfo = SysSQLSystemInfo::construct();
loginProperty.setServer(systemInfo.getLoginServer());
loginProperty.setDatabase(systemInfo.getloginDatabase());
odbcConnection = new OdbcConnection(loginProperty);
// Create new Statement instance
statement = odbcConnection.CreateStatement();