Tuesday, March 27, 2012

Data source name not found and no default driver specified - When the website was publishe

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[OdbcException (0x80131937): ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified] System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) +35 System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle) +131 System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +98 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.Odbc.OdbcConnection.Open() +37 DBConnection.open() +12 ASP.global_asax.Session_Start(Object sender, EventArgs e) +35 System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e) +2163182 System.Web.SessionState.SessionStateModule.CompleteAcquireState() +154 System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +542 System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +90 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

ODBC version 3.526.1830.0
strconn ="DSN=testserver;uid=tester;pwd=tester;DATABASE=Test_Database"

I've Test_Database on 2 machines (same data in both machines), one is in SQL 2005 server and another one is in SQL 2000 server.
When the website was published, it can't work. (with both database). But it work in debug mode in Visual Studio2005.

The website can't work when use ODBC connection but it work when use SqlClient.

Help me solve this problem please. T_T

Thanks in advance,

Did you create the ODBC DSN in your local machine?|||Yes sir , I've use ODBC while I develop this website. It can run in debug mode sir !|||

Ok, just let me know if you are getting this error on localhost or on a hosting server?

Also don't call me SirSmile

|||

I get this error nn localhost.

Database is on localhost(SQL2005) and other one is on another machine(SQL2000).

|||

Ok, check

www.connectionstrings.com

And make sure your connectionstring is correct.

Regards

|||

Yeah , It's resolved.

I added wrong DSN. I added it in User DSN. T_T

So I add new DSN in File DSN and the website work.

Thanks for your advice,

Regards,

|||

buabanz:

So I add new DSN in File DSN and the website work.

Oh sorry, I've added it in System DSN.

sql

No comments:

Post a Comment