tags:

views:

53

answers:

2

Hi i have an application developed on XP with Text ODBC drivers. But when i deployed on Win 7 with office 2007, i have connection issues.

<add key="SQLConnection.TextConnectionString" value="Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=c:\Data\;Extensions=asc,csv,tab,txt;Persist Security Info=False" />

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


i have googled every solutions like installing the following

http://blogs.msdn.com/b/sqlblog/archive/2009/12/29/how-to-connect-to-file-based-data-sources-microsoft-access-microsoft-excel-and-text-files-from-a-64-bit-application.aspx

Microsoft Access Database Engine 2010 Redistributable (32-bit)

2007 Office System Driver: Data Connectivity Components

after all of those, in my datasources(ODBC), it still only shows "SQL native client/SQL server/SQL server native client"

in the C:\Windows\SysWOW64\odbcad32.exe

i can see all the x32 drivers, but how can i modify my connection strings to access 32-bit Microsoft Text Drivers or are there any alternative solutions? Thanks

+1  A: 

I'm pretty sure it'll work automatically (even on a 64-bit machine) as long as the executing process is 32-bit.

Try recompiling to target x86 specifically.

Cameron
my target set as'any cpu'
Kiddo
"my target set as'any cpu'" -- That's exactly the reason why this answer suggested "Try recompiling to target x86 specifically."
Windows programmer
@Kiddo: Yes -- try changing it to 'x86'
Cameron
A: 

You need the 64-bit Microsoft Access Database Engine 2010 Redistributable

http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;displaylang=en

Then try

Microsoft Access Text Driver (*.txt, *.csv)

for the driver name.

AFAIK, all 64-bit ODBC drivers from the Microsoft Access Database Engine 2010 64-bit Redistributable have slightly changed their driver names, I guess to differentiate them from their 32-bit counterparts.

jumpinjackie
it won't allow me to install 64-bit Redistributabl cuz my officer product is 32-bit
Kiddo
It will, you just have to uninstall the 32-bit office, install the 64-bit redist, then reinstall the 32-bit office. Whether you want to go through this pain is your call :)
jumpinjackie

related questions