错误[IM002] [Microsoft] [ODBC驱动程序管理器]

时间:2011-10-25 09:15:28

标签: c# odbc

在VS中破坏了一个简单的数据库连接代码,它的功能非常好 这是连接字符串:

CONN_STRING = Dsn={0};dbq={1};description=Algo Financial Modeler ODBC Driver;maxcolsupport=5000;model={2}

我用驱动程序Algo Financial Modeler ODBC Driver

创建了一个系统dsn

但是当我试图在cmd中将其作为exe运行时,我收到此异常

Unhandled Exception: System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver s pecified 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, DbConn ection 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 VipTst1.Program.Main(String[] args) in c:\vip\VipTst1\VipTst1\VipTst1\Program.cs:line 15 感谢

0 个答案:

没有答案