1201090 - Error: "536 Error in File <path>report.rpt; Unable to connect: incorrect log on parameters" when using Crystal Reports XI VCL

SAP Knowledge Base Article - Public

1201090 - Error: "536 Error in File <path>report.rpt; Unable to connect: incorrect log on parameters" when using Crystal Reports XI VCL

Symptom

A report created on a SQL database with an OLEDB connection is run using the Crystal Reports XI VCL. The custom application programmatically changes the datasource to a different table using the following code:
 
Crpe1.Tables[0].ConnectBuffer := 'DSN=dsn;;User Id=uid;;Password=pwd;;database=pubs;;UseDSNProperties=0';
Crpe1.Tables[0].Name := 'pubs_sales';
 
This results in the following error message: 
"Error: 536 Error in File <path>report.rpt;
Unable to connect: incorrect log on parameters."

Resolution

Instead of setting the Name property, use the AliasName.
 
For example:
Crpe1.Tables[0].ConnectBuffer := 'DSN=dsn;;User Id=uid;;Password=pwd;;database=pubs;;UseDSNProperties=0';
Crpe1.Tables[0].AliasName := 'pubs_sales';

Keywords

DELPHI ALIASNAME connect location db , 5395481 , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , Problem

Product

SAP Crystal Reports XI ; SAP Crystal Reports XI R2