My contemplations and diurnal novelties are publicized here


I recently run into a problem where I using following connection string for a csv file

this.ConnectionString = @”Driver={Microsoft Text Driver (*.txt; *.csv)};Extensions=asc,csv,tab,txt;Dbq=” + @FolderPath;

But I always give me Data source name not found and no default driver specified error. I was using Window 7, 64 Bit and Office 2010 (it’s 32 bit app) Installed. The suggested solution was to

  1. Uninstall any 32-bit Office apps.
  2. Install the Access 64-bit drivers
  3. Re-install any 32-bit Office apps

If you try to install access 64 bit without un-installing 32 bit office products it gives following error


Un-installing 32-bit office was sort of impossible solution for me, so I opted for another solution

I Opened the registry editor and browse to the location

HKEY_CLASSES_ROOT\Installer\Products\ 00002109030000000000000000F01FEC

Here most of the keys are related to MS office application so I renamed them to include a prefix of “.” E.g .00002109030000000000000000F01FEC


Then I installed Access 64-bit drivers, It worked like a charm. Then I re-booted the system and again renamed all them back to their original name excluding only one shown below.

Other step I have to was to change connection string to

this.ConnectionString = @”Driver={Microsoft Access Text Driver (*.txt, *.csv)};Extensions=asc,csv,tab,txt;Persist Security Info=False;Dbq=” + @FolderPath;

References:-

  1. http://stackoverflow.com/questions/6490543/data-source-name-not-found-and-no-default-driver-specified
  2. http://social.msdn.microsoft.com/Forums/nl-NL/adodotnetdataproviders/thread/abf34eea-1029-429a-b88e-4671bffcee76
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: