Opening dBase file with extension other than .dbf  
Author Message
Jack.NET





PostPosted: .NET Framework Data Access and Storage, Opening dBase file with extension other than .dbf Top

Hi I'm trying to open a dBASE file with non-standard file extension using ADO and JScript. My code is as follows:

var szDatabasePath = "C:\\Example\\";

var szConnection = "Driver={Microsoft dBase Driver (*.dbf)};DriverID=277;Dbq="
+ szDatabasePath;

var oDBConn = new ActiveXObject("ADODB.Connection");
oDBConn.Open(szConnection);

var oRS = oDBConn.Execute("SELECT * FROM example#ven");

The output is as follows:

C:\Example\Parse.js(14, 1) Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC dBase Driver] The Microsoft Jet database engine could not find the object 'example.ven'. Make sure the object exists and that you spell its name and the path name correctly.

If I rename file to .dbf extension, it works. How can I get this to work with different extension I am following documentation from:

http://www.hide-link.com/ %3Ben-us%3B101742

Thanks!




.NET Development12  
 
 
Jack.NET





PostPosted: .NET Framework Data Access and Storage, Opening dBase file with extension other than .dbf Top

To answer my old question, this issue only comes up if the table has a memo text column in it. The memo column data is stored in a separate file called .dbt. In such a case, the main file must be .dbf. If there is no memo column, the table file can have any extension.

 
 
Paul P Clement IV





PostPosted: .NET Framework Data Access and Storage, Opening dBase file with extension other than .dbf Top


You may be able to use the Visual FoxPro OLEDB Provider. See the following newsgroup post:

http://tinyurl.com/yct8dy



 
 
Cindy Winegarden





PostPosted: .NET Framework Data Access and Storage, Opening dBase file with extension other than .dbf Top

Hi Paul,

The extension for FoxPro memo fields is FPT, not DBT, so I doubt the VFP OLE DB data provider would work in this case.



 
 
Paul P Clement IV





PostPosted: .NET Framework Data Access and Storage, Opening dBase file with extension other than .dbf Top


Hi Cindy,

If I understood his question correctly it looked like he was referring to dBase files that did not contain a memo field. If the dBase database contains a memo field then the file extension must be .dbf.

So, I would think your suggestion (from the newsgroup link I posted) should work for him. I didn't notice that the OP was over eight months ago. ;-)