HI,
We are facing the "Unable to connect: Incorrect log on parameter" using crystal runtime 2010 for .NET(Service pack 2) in our application.
In our application, all the reports are working fine but the problem mainly occurs when the customers develop custom reports and trying to
launch the report it display Database Login prompt. But when i preview the custom report using the crystal designer its working proper.
I believe that the report was created using trusted connection on the datasource.
When I try to launch the custom report from the application it throws error like the below:(we are using SQL server 2008 R2)
after settablelogoninfo, Server Name=LAP-02-1351_SQLSERVER200832, Database Name=SAMLTD, User ID=sa, Password=password!23
00000040 16.05691338 [5592] this->m_bstrServerName=LAP-02-1351_SQLSERVER200832
00000041 16.06206512 [5592] Odbc, this->GetCrInterop()->SetTableLocation,m_bstrLocation=OEORDH ConBuf=DSN=LAP-02-1351_SQLSERVER200832;;User ID=sa;;Password=password!23;;UseDSNProproperties=0
00000042 16.51541901 [5592] 1. tblOdbc, SetTableLocation failed
00000043 16.51549911 [5592] CCrystnet::SetTableLocation, catch ...index=0 Logon failed. Error in File OEBACKORDER {A90E3D0A-7D95-4BDE-A86E-A4B9975F065E}.rpt:
00000044 16.51549911 [5592] Unable to connect: incorrect log on parameters.
We are using the below code for table logon but its working fine.
public void SetTableLogonInfo(short tableIndex, string server, string database,
string ID, string password, short driverType)
{
TableLogOnInfo logonInfo = rptDocument.Database.Tables[tableIndex].LogOnInfo;
logonInfo.ConnectionInfo.ServerName = server;
logonInfo.ConnectionInfo.DatabaseName = database;
logonInfo.ConnectionInfo.UserID = ID;
logonInfo.ConnectionInfo.Password = password;
m_sUserID = ID;
m_sPwd = password;
string sDBType = GetDatabaseType(tableIndex);
rptDocument.Database.Tables[tableIndex].ApplyLogOnInfo(logonInfo);
}
During setting the location to the table we are facing the above problem especially for custom report Please find the attached custom report for the reference. Also in this method we are getting tableindex and slocation parameter properly. Problem occuing during executing this code: "rptDocument.Database.Tables[tableIndex].Location = sLocation;" Also attaching the error message.
public void SetTableLocation(short tableIndex, string sLocation)
{
rptDocument.SetDatabaseLogon(m_sUserID, m_sPwd);
rptDocument.Database.Tables[tableIndex].Location = sLocation;
}
All our application report are using same piece of code but its working fine.
Previously we have used Crystal XI R2, when I try to launch the same custom report, its properly launches the report without any error.
Also am attaching the CRlogger file for your reference. Error are like the below:
2013-3-1-6-31-8 3648 .\odbcerror.cpp 63 Error: message = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed. The login is from an untrusted domain and cannot be used with Windows authentication., sqlstate = 28000, native code = 18452 1
2013-3-1-6-31-8 3648 .\odbcerror.cpp 63 Error: message = [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed, sqlstate = IM006, native code = 0 1
2013-3-1-6-31-8 3648 .\odbcerror.cpp 63 Error: message = [Microsoft][SQL Server Native Client 10.0]Invalid connection string attribute, sqlstate = 01S00, native code = 0 1
2013-3-1-6-31-8 3648 .\odbcapi.cpp 301 Beginning COdbcapi::DriverConnect 20
Also i gone through this link: http://scn.sap.com/thread/1855003 which talks more about this issue and tried SP5 too.
Please suggest your input.
Thanks,
Somasekar