none
Windows 2008 64bit, odbc, text, (2146232009 ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified )

    Question

  • After upgrading from XP 32bit to Windows 2008 64bit, the same code doesn't work.

    Basically I'm using this connection string for accessing to 66 text files and put them all together in a datatable:

    Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=c:\importaciones\;

    I can't use OLEDB because as you may know, Microsoft won't ship a 64 bit version of Microsoft.Jet.OLEDB.4.0 (it worked fine under XP 32bit)

    In few words, how can I access to text files (this issue is extensible to excel files) using pure 64 bit? Streamreaders are not a solution. (64bit was a bad decission but it's a reallity in our ITC) ;-)

    Thanks for your valuable help.

    Thanks for your valuable help - Yours, Josep Balague
    Tuesday, June 02, 2009 11:19 AM

Answers

  • Hi Michael,

    It works. I tested it. But our requeriments are 64 bit in a 64 platform, not 32 bit ....

    thanks for your answer.

    Regards,


    Thanks for your valuable help - Yours, Josep Balague
    • Marked as answer by Josep Balague Friday, October 29, 2010 11:12 AM
    Wednesday, June 03, 2009 8:49 AM

All replies

  • Unfortunately there are no 64-bit data drivers or providers for Text or Excel files. The file I/O classes are the only options for Text files and Excel automation for Excel files. The only data access option I can think of would be to create linked tables (servers) to these files in SQL Server and access them this way.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Tuesday, June 02, 2009 1:05 PM
  • Hi Paul,

    thanks for your quick answer.

    I have noticed there are two ODBC administrators in a 64bit computer: ODBC 32bit is placed in c:\windows\syswow64\odbcad.exe and ODBC 64bit version is placed in c:\windows\system32\odbcad32.exe. In 32bit version all old drivers are present. Now the question is: "how programatically access with c# 2.0 to ODBC 32bit drivers within a 64bit program?"

    Regards.


    Thanks for your valuable help - Yours, Josep Balague
    Wednesday, June 03, 2009 6:28 AM
  • I believe that what you have to do is to compile your .net program as 32bit (default is compiling as AnyCpu).
    By compiling as 32 bit, the application will use the correct directories.

    C# Language Reference - /platform (Specify Output Platform) (C# Compiler Options)
    http://msdn.microsoft.com/en-us/library/zekwfyz4.aspx

    HTH
    //Michael
    This posting is provided "AS IS" with no warranties.
    Wednesday, June 03, 2009 7:37 AM
  • Hi Michael,

    It works. I tested it. But our requeriments are 64 bit in a 64 platform, not 32 bit ....

    thanks for your answer.

    Regards,


    Thanks for your valuable help - Yours, Josep Balague
    • Marked as answer by Josep Balague Friday, October 29, 2010 11:12 AM
    Wednesday, June 03, 2009 8:49 AM