chrisl91
May 15th, 2006, 09:27 PM
I'm having trouble getting my report viewer to open reports from an Oracle 9i database. Access and SQL work fine but I can't figure out the connection info needed to get Oracle to work.
We are using RDC craxdrt.dll (11.0.0.1830) reporting engine with crviewer.dll (11.0.0.2043) ActiveX for report previewing in our viewer application.
The issue we seem to have is what parameters do we pass to SetLoginInfo function to properly allow the reporting engine to connect to an Oracle database. Here is the current code.
m_Server = _RT("oracleDSN;SERVER=") + m_Database;
m_Database = _RT(""); // don't need database if server is set
m_User = _RT("SCOTT");
m_Password = _RT("TIGER");
IDatabaseTablesPtr tables = report->GetDatabase()->GetTables();
long count = tables->GetCount(); // 1-based index
for (int i = 1; i <= tables->GetCount(); i++)
{
IDatabaseTablePtr table = tables->GetItem(i);
table->SetLogOnInfo(m_Server, m_Database, m_User, m_Password);
....
I've left some code out obviously but I've tried to include the pertinent information. I can provide more code if needed.
I usually get an error message that says something like "Error: Failed to retrieve data from the database, Database vendor code -1234xxxxxx".
Thanks for any help you can give,
Chris
We are using RDC craxdrt.dll (11.0.0.1830) reporting engine with crviewer.dll (11.0.0.2043) ActiveX for report previewing in our viewer application.
The issue we seem to have is what parameters do we pass to SetLoginInfo function to properly allow the reporting engine to connect to an Oracle database. Here is the current code.
m_Server = _RT("oracleDSN;SERVER=") + m_Database;
m_Database = _RT(""); // don't need database if server is set
m_User = _RT("SCOTT");
m_Password = _RT("TIGER");
IDatabaseTablesPtr tables = report->GetDatabase()->GetTables();
long count = tables->GetCount(); // 1-based index
for (int i = 1; i <= tables->GetCount(); i++)
{
IDatabaseTablePtr table = tables->GetItem(i);
table->SetLogOnInfo(m_Server, m_Database, m_User, m_Password);
....
I've left some code out obviously but I've tried to include the pertinent information. I can provide more code if needed.
I usually get an error message that says something like "Error: Failed to retrieve data from the database, Database vendor code -1234xxxxxx".
Thanks for any help you can give,
Chris