상세 컨텐츠

본문 제목

Message Error Im002 Microsoft Odbc Driver

카테고리 없음

by fulllapworkke1970 2020. 3. 18. 19:53

본문

I had the same issue with office 2010 64 bit installed. To elaborate on DHomes post I did the following:1- Download 32-bit version of AccessDatabaseengine1A-2- Place download in your desired directory3- Install 32bit driver in passive mode3A- You will get an error if you try to install the 32 bit driver by double clicking it3B- You need to open the command line (Start–Search–cmd)3C- type in the path to the AccessDatabase Engine you downloaded then space /passive4C- Example: C:GPSharedSmartConnectAccessDatabaseEngine.exe /passiveI had to do some testing to get the proper command line prompt and wanted to share with everyone. Thanks for pointing me in the right direction DHomes.

Microsoft Odbc Driver Manager Error

MessageMessage error im002 microsoft odbc driver manager

Im002 Odbc Driver

You should be using the SqlClient library for your command, not ODBC: Dim connect = ConfigurationManager.ConnectionStrings('projectconnection').ConnectionStringUsing conn = New SqlConnection(connect)Dim sql = 'INSERT INTO keidc.dbo.SUPPLIERTKDNDETAIL (a, b, c, d, e) values ('1', '2', '3', @p1, 'IDR')'Dim cmd = New SqlCommand(sql, conn)conn.Opencmd.Parameters.AddWithValue('@p1', textboxValue.Trim.Replace(',', '))cmd.ExecuteNonQueryEnd UsingYou should also use parameters instead of concatenating user input with SQL that you intend to execute against a database. Otherwise your application is open to SQL injection attacks which can prove catastrophic. Also, you don't need to set the CommandTypeof the command if you are passing Text (as opposed to a stored procedure) because Text is the default type. Use a Using block for connections. That way you don;t have to remember to close them because the Using block does that for you.Finally, try to keep your strings on one line unless there is a good reason that you can't, otherwise your code becomes unreadable and very difficult to manage at a later date.