Share via


"Logon failed. Details: IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"

Question

Monday, September 22, 2008 6:32 AM

When i attempt to fill my Crystal Report -named limitler.rpt and it is under the sub-folder Oraburslar of my project -, i get the following error;

"ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. Error in File C:\DOCUME~1\KEMAL~1.ESM\LOCALS~1\Temp\limitler {148B6FE6-D5BE-4BC3-A13A-47CCCB79D78B}.rpt: Unable to connect: incorrect log on parameters."

How can i handle this pro?

Thanks in advance...

Here is how i connect to database to fill the Crystal Report:

string database = ConfigurationManager.AppSettings["Database"].ToString();

string password = ConfigurationManager.AppSettings["Password"].ToString();

string username = ConfigurationManager.AppSettings["Username"].ToString();

string server = ConfigurationManager.AppSettings["Server"].ToString();

ReportDocument report = new ReportDocument();report.Load(Server.MapPath("~/Oraburslar/limitler.rpt"));

report.SetDatabaseLogon(username, password);

CrystalReportViewer1.ReportSource = report;

CrystalReportViewer1.BackColor = System.Drawing.Color.White;

All replies (11)

Tuesday, September 23, 2008 3:13 AM

Hi,

Is the DSN that the report uses on the web server that you have it deployed to? Also, make sure the DSN is defined as a system DSN and not a User DSN.

Regards,
Origin Software, Inc.
www.originsoftware.net


Tuesday, September 23, 2008 3:30 AM

Well, i don't connect to a web server. I just build and run my project locally. Just database is on the server, not the project icluding all crystal reports (.rpt files). What kind of arrangements do i need?

 Here is the html of my CrystalReportViewer :

<CR:CrystalReportViewer id="CrystalReportViewer1" runat="server" __designer:wfdid="w4" EnableParameterPrompt="False" EnableDatabaseLogonPrompt="False"></CR:CrystalReportViewer>


Tuesday, September 23, 2008 3:53 AM

Hi,

Same thing applies. Make sure your DSN is a System DSN and not a User DSN. Also, make sure to supply the "Server" and "Database" logon credentials. In your sample code it appears your retrieving, but not using, the "Server" and "Database" logon info.

Regards,
Origin Software, Inc.
www.originsoftware.net


Tuesday, September 23, 2008 4:17 AM

I noticed this and applied it. In System DSN tab and in User DSN files exist drivers. How should i make sure that mine is a system DSN?

 

Here they are:

System DSN: Xtreme Sample Database 2005, Microsoft  Access Driver

User DSN: Microsoft dBASE Drivers, Microsoft  Excel Drivers, Microsoft   MS Access Drivers, Microsoft  Visual FoxPro Drivers, Microsoft  Visual FoxPro Drivers


Tuesday, September 23, 2008 11:02 PM

Hi,

What DSN is your report built off of?

Regards,
Origin Software, Inc.
www.originsoftware.net


Wednesday, September 24, 2008 4:09 AM

I first added Microsoft ODBC for Oracle to both System DSN and User DSN from  Control Panel>Administrator Tools>ODBC item.

Then i created new connection and choosed ODBC(RDO) and Oracle ODBC Driver -the one i had added before in the way i mentioned above-,  using database expert.

Next i set user id and password, the service was already choosen as Oracle ODBC Driver. It threw the following errors;

 "NA000:[Microsoft][ODBC Driver for Oracle][Oracle]ORA-12560: TNS: protocol adapyer error"

Query Engine Error: IM006: [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed'

Logon failed Details: 01000:[Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behaviour that the application requested (see SQLSetEnvAttr)

 

Then, i created another new connection and rather prefered to choose OLE DB(ADO) and Oracle OLE DB Provider for Oracle, after that i set the service as database name , user id and password. This time it managed to create a new connection. I finally choosed the table from which i wantto retrieve the data.

Finally i run the codes as below:

string database = ConfigurationManager.AppSettings["Database"].ToString();

string password = ConfigurationManager.AppSettings["Password"].ToString();

string username = ConfigurationManager.AppSettings["Username"].ToString();

string server = ConfigurationManager.AppSettings["Server"].ToString();

ReportDocument report = new ReportDocument();report.Load(Server.MapPath("~/Oraburslar/limitler1.rpt"));

report.SetDatabaseLogon(username, password, server, database);

CrystalReportViewer1.ReportSource = report;

CrystalReportViewer1.BackColor = System.Drawing.Color.White;

It threw the followings error message:

Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for Oracle Description: ORA-01017: invalid username/ password.; logon denied Native Error: Error in File C:\DOCUME~1\KEMAL~1.ESM\LOCALS~1\Temp\limitler1 {299CD347-B709-465B-9E78-B26C23FA9CC4}.rpt: Unable to connect: incorrect log on parameters.

I couldn't resolve...

Thanks...


Thursday, December 4, 2008 5:24 PM

I have the same problem, but stranger... I have 3 Crystal Reports in 1 program. All 3 use the same procedure to load and display. I got #1 & #2 working yesterday and #3 working today. When I went to test the whole program, #1 and #3 work fine, #2 now gives the same error you have:

Logon failed.
Details: IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Error in File C:\DOCUME~1\bjones\LOCALS~1\Temp\sallam_summary_v3 {E73A6872-BB64-4196-B2B3-4E4441B6948B}.rpt:
Unable to connect: incorrect log on parameters.

I can open the Crystal Report in VS 2005, and it displays fine in the Developers Window (Main Report Preview) - prompts for the parameters and login info and displays. In the program, I set the parameters pass the login information and it gives the error. I know "2 out of 3 aint bad", but this shouldn't be, especially since it was working yesterday...

 I hope someone out there has an answer to this predicament. It's not like the procedure is changing while the program is running...


Tuesday, January 6, 2009 12:11 PM

Crystal reports has the worst api i've ever seen. You will see 1000s upon 1000s of connection error - related posts by programmers. If I configure a report to use a single ODBC connection, then set valid user, password, and dsn there should be no reason for the login errors to occur.


Sunday, April 19, 2009 1:01 PM

Although it is misleading, try setting the ServerName to be the system DSN


Wednesday, December 2, 2009 5:12 AM

This usual problem happens only to the Older version of CrystalReports caller from VB to .Net world.

 

Nothing to worry. Please use like this.........

connectionInfo.DatabaseName = "MahendrenDataBase"

connectionInfo.ServerName ="SystemDSN";//Create a system dsn.

connectionInfo.UserID = "UID";

connectionInfo.Password="Pwd"

// even you call reach me to 99625-11288 also if problem still exist.

 


Thursday, September 9, 2010 12:04 AM

Hi Origin Software,

I know this is very old thread but in case if you come back some day.. I wanted to thank you.. you saved my day..

I was looking for solution for this error for 2 days and was going mad.. your hint to check DSN type saved me... thanks a lot...