jlaverde
jlaverde

Reputation: 338

ERROR [IM002] [Microsoft][ODBC Driver Manager] on Windows XP

I've made a VB.NET program that accesses some databases via ODBC. On the Windows 7 machine it works fine. On the Windows XP machine it installs, but when it open the application, this error happens. I developed this on Visual Studio 2012, both Windows 7 and Windows XP are x86, and both have the same System DSN's I'm trying to access. I've looked everywhere, but nothing specific to my problem. Any ideas? Thanks in advance!

************** Exception Text **************
System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
   at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
   at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)
   at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions)
   at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.Odbc.OdbcConnection.Open()
   at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
   at CRManager.DataSet3TableAdapters.PartitionsSetTableAdapter.Fill(PartitionsSetDataTable dataTable)
   at CRManager.Form1.Form1_Load(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3649 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Crystal Reports Manager
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/jose.laverde/Local%20Settings/Apps/2.0/BOZHZTXY.AG4/CEDJGE66.BYJ/crys..tion_d4261ff73e300d69_0001.0001_e75947b0658a5fbd/Crystal%20Reports%20Manager.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3644 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3645 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3644 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
Microsoft.VisualBasic.PowerPacks.Vs
    Assembly Version: 10.0.0.0
    Win32 Version: 11.0.50727.1
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic.PowerPacks.Vs/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.PowerPacks.Vs.dll
----------------------------------------
CrystalDecisions.Windows.Forms
    Assembly Version: 13.0.2000.0
    Win32 Version: 13.0.5.891
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.Windows.Forms/13.0.2000.0__692fbea5521e1304/CrystalDecisions.Windows.Forms.dll
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3650 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
CrystalDecisions.Shared
    Assembly Version: 13.0.2000.0
    Win32 Version: 13.0.5.891
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.Shared/13.0.2000.0__692fbea5521e1304/CrystalDecisions.Shared.dll
----------------------------------------
CrystalDecisions.ReportSource
    Assembly Version: 13.0.2000.0
    Win32 Version: 13.0.5.891
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportSource/13.0.2000.0__692fbea5521e1304/CrystalDecisions.ReportSource.dll
----------------------------------------
log4net
    Assembly Version: 1.2.10.0
    Win32 Version: 1.2.10.0
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/log4net/1.2.10.0__692fbea5521e1304/log4net.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3650 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Web
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3648 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
System.Data.DataSetExtensions
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.30729.1 built by: SP
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.DataSetExtensions/3.5.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
----------------------------------------
System.Core
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.30729.1 built by: SP
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Transactions
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------

Upvotes: 4

Views: 15712

Answers (3)

user3576362
user3576362

Reputation: 1

Thank you for this post, it solved my problem, though in my case, I had a VB project that worked fine on a SQLExpress database but gave me the above error when I tried to change the connection string to an Access database. But on another project, I connected to an Access database just fine. The 'Any CPU' was set and I changed that to 'x86' and then it worked for me.

Upvotes: 0

user2696636
user2696636

Reputation: 51

Got the same problem. Had 1 VB proj on Windows 7 64 bit that worked fine. Started another project, copied the code over I needed and it failed saying couldn't find DSN. Having read Frank's comment, I went into Configuration Manager in VS 2010 and added a new "Active Solution Platform" of "Any CPU" and reran my project and all worked fine. My project was now 64 bit like the other project that worked.

Kristian

Upvotes: 2

FrankPl
FrankPl

Reputation: 13315

The error message clearly states that your program does not find the DSN. Check that the bitness of the DSNs is correct. See http://support.microsoft.com/kb/942976 for a description of some of the 64bit/32bit confusion.

Upvotes: 4

Related Questions