Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Unable to connect: incorrect log on parameters. Post Reply Post New Topic
Author Message
Sagitariusmzi
Newbie
Newbie


Joined: 27 Aug 2010
Location: Pakistan
Online Status: Offline
Posts: 1
Quote Sagitariusmzi Replybullet Topic: Unable to connect: incorrect log on parameters.
    Posted: 27 Aug 2010 at 8:13pm
Hi,

     I am using vs2008 and Crystal Reports 9
for a windows application using c#

i am getting the following error
""Logon failed.
Details: IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Error in File C:\DOCUME~1\Zafar\LOCALS~1\Temp\RptAngio {E983CDAD-A4E6-4BDD-8420-DD48839EF293}.rpt:
Unable to connect: incorrect log on parameters.""

this is my code


 rptObj = new ReportDocument();
            ConnectionInfo oConnectionInfo = new ConnectionInfo();
            TableLogOnInfo oTableLogOnInfo = new TableLogOnInfo();


            oConnectionInfo.ServerName = "win2k3";
            oConnectionInfo.DatabaseName = "HMS";
            oConnectionInfo.UserID = "dhmc";
            oConnectionInfo.Password = "dhmc152jt";

            rptObj.Load(@"G:\UpGrade\Angio\DotNet\OPDAngio\UI\Reports\RptAngio.rpt");

            foreach (CrystalDecisions.CrystalReports.Engine.Table oTable in rptObj.Database.Tables)
            {
                oTableLogOnInfo = oTable.LogOnInfo;
                oTableLogOnInfo.ConnectionInfo = oConnectionInfo;
                oTable.ApplyLogOnInfo(oTableLogOnInfo);
            }

            for (int i = 0; i <= rptObj.Database.Tables.Count - 1; i++)
            {
                rptObj.Database.Tables.Location = oConnectionInfo.DatabaseName + "." + "dbo" + "." + rptObj.Database.Tables.Location.Substring(rptObj.Database.Tables.Location.LastIndexOf(".") + 1);
            }


this is my connection
<add name="AngioCONNECTION"  connectionString="Data Source=win2k3;Initial Catalog=HMS;User Id=dhmc;pwd=dhmc152jt;" providerName="System.Data.SQLOLEDB" />



can anyone help me on this problem?
Regards


Edited by Sagitariusmzi - 27 Aug 2010 at 8:16pm
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.033 seconds.