Joe
Fri Jul 04 06:13:39 CDT 2008
Hello,
Here is the code I am running:
string connString = @"Provider=vfpoledb.1;Data Source=C:\test\;Collating
Sequence=general;";
OleDbConnection conn = new OleDbConnection(connString);
OleDbDataAdapter da = new OleDbDataAdapter("select * from
EQR_TRANSACTION_200803.dbf", conn);
DataTable table = new DataTable("table");
da.Fill(table);
The connString doesn't mention the dbc. Also I don't know where it even gets
the name of the dbc it is looking for.
-Joe
"Jialiang Ge [MSFT]" <jialge@online.microsoft.com> wrote in message
news:uFMUHma3IHA.1436@TK2MSFTNGP05.phx.gbl...
> Hello Joe,
>
> ¡°Dbc¡± is the file extension for Foxpro database; and ¡°dbf¡± is for
> tables associated with the database. According to the error, it seems that
> you are using the connection string:
>
> Driver={Microsoft Visual FoxPro
> Driver};SourceType=DBC;SourceDB=c:\myvfpdb.dbc;Exclusive=No;
> NULL=NO;Collate=Machine;BACKGROUNDFETCH=NO;DELETED=NO;
>
> To connect to the database container (.dbc), and it fails to find the dbc?
>
> Please try the connection strings for ¡°Free table directory¡±. The DBF
> (free table) connection string only refers to the directory containing the
> DBF, it does not specify a target table. All free tables within the
> directory are then available for use in the recordset SQL statement.
>
> You may also want to read Cindy Winegarden [Foxpro MVP]¡¯s comments in
> this thread:
>
http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic35499.aspx
>
> Regards,
> Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
>
> =================================================
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> =================================================
>
> "Joe" <jbassking@noemail.noemail> wrote in message
> news:e4HDn8Q3IHA.1192@TK2MSFTNGP05.phx.gbl...
>> Using the connection string from the link below it seems to connect but I
>> get an error message Cannot open file c:\test\eqr.dbc.
>>
>> What is a dbc file? I can open the dbf using a few programs I downloaded
>> but cannot open it in C#.
>>
>> "Jialiang Ge [MSFT]" <jialge@online.microsoft.com> wrote in message
>> news:%23LtMrXO3IHA.2336@TK2MSFTNGP03.phx.gbl...
>>> Hello
>>>
>>> I know some known scenarios where dBase Driver does not co-operate with
>>> Foxpro well. We generally suggest customers using OLE DB Provider for
>>> Visual FoxPro:
>>>
http://www.microsoft.com/downloads/details.aspx?familyid=e1a87d8f-2d58-491f-a0fa-95a3289c5fd4&displaylang=en
>>>
>>> The sample connection strings based on Microsoft Visual FoxPro Driver
>>> can be found at:
>>>
http://www.connectionstrings.com/?carrier=visualfoxpro
>>>
>>> Bill, would you please try the Foxpro driver instead? If you have any
>>> concerns about, please DON¡¯T hesitate to tell me.
>>>
>>> Regards,
>>> Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
>>> Microsoft Online Community Support
>>>
>>> =================================================
>>> Delighting our customers is our #1 priority. We welcome your comments
>>> and suggestions about how we can improve the support we provide to you.
>>> Please feel free to let my manager know what you think of the level of
>>> service provided. You can send feedback directly to my manager at:
>>> msdnmg@microsoft.com.
>>>
>>> This posting is provided "AS IS" with no warranties, and confers no
>>> rights.
>>> =================================================
>>>
>>> "Jim Rand" <jimrand@ix.netcom.com> wrote in message
>>> news:uxjUzHH3IHA.1808@TK2MSFTNGP04.phx.gbl...
>>>> Download VfpOleDB.dll
>>>>
>>>>
>>>>
>>>> "Joe" <jbassking@noemail.noemail> wrote in message
>>>> news:%23mtyRsG3IHA.1420@TK2MSFTNGP06.phx.gbl...
>>>>> Hi all.
>>>>>
>>>>> I'm trying to open a dbf file which appears to be FoxPro. I've tried
>>>>> using the OLE and ODBC classes but I'm not having any luck.
>>>>>
>>>>> I keep getting an exception: "The Microsoft Jet database engine could
>>>>> not find the object 'EQR_TRANSACTION_200803'. Make sure the object
>>>>> exists and that you spell its name and the path name correctly."
>>>>>
>>>>> Here is the ODBC code:
>>>>> try
>>>>>
>>>>> {
>>>>>
>>>>> string connString = @"DBQ=C:\Test;Driver={Microsoft dBase Driver
>>>>> (*.dbf)}; DriverId=277";
>>>>>
>>>>>
>>>>> OdbcConnection conn = new OdbcConnection(connString);
>>>>>
>>>>> OdbcDataAdapter da = new OdbcDataAdapter("select * from
>>>>> EQR_TRANSACTION_200803", conn);
>>>>>
>>>>> DataTable table = new DataTable("table");
>>>>>
>>>>> da.Fill(table);
>>>>>
>>>>> dataGridView1.DataSource = table;
>>>>>
>>>>> }
>>>>>
>>>>> catch (Exception e)
>>>>>
>>>>> {
>>>>>
>>>>> MessageBox.Show(e.Message);
>>>>>
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>> Any ideas?
>>>>>
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Joe
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>