views:

158

answers:

2

microsoft visual studio opens my table using dataset designer
but i cannot open my table using the same connectionstring.
my database is DBase IV.
and this is the connectionstring

Driver={Microsoft dBASE Driver (*.dbf)};collatingsequence=ASCII;dbq=d:\Data\88;deleted=0;driverid=277;fil=dBase IV;maxbuffersize=2048;maxscanrows=8;pagetimeout=600;safetransactions=0;statistics=0;threads=3;uid=admin;usercommitsync=Yes

it is made by visual studio itself.
and this is my code

DataSet1TableAdapters.AN10TableAdapter _AN10TableAdapter = new DataSet1TableAdapters.AN10TableAdapter();  
_AN10TableAdapter.Fill(D_Data.AN10);

and this is the error

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

this real joke is killing me.
platform:vista x64
language:c#.net
.netframework vesion:3.5
worked on it:10 days

A: 

Do you have the dBase data sources installed?

  1. Control Panel -> Administrative Tools -> Data Sources (ODBC)
  2. System DSN tab

(My OS is Windows XP but that's the idea.)

John at CashCommons
+2  A: 

I guess the issue is the 64-bitness of your machine. The driver is an unmanaged component and you probably have a single version of it (32-bit or 64-bit) installed on your machine. Since you cannot load 32-bit unmanaged components in a 64 bit process (and vice versa), it'll not work. Switch the target CPU setting of your project to x64 and x86 to force the assembly to run with the appropriate bitness and retry. It's likely to solve your problem.

Mehrdad Afshari
i know that.but why does visual studio browse everything of my table.it can select, insert, etc ...
Behrooz
@behrooz: Visual Studio is a 32-bit app running in WOW64 mode. It can perfectly work with 32 bit ODBC drivers.
Mehrdad Afshari
it worked very nice.!اصلا به این فکر نکرده بودم
Behrooz