Reading DBF with VFPOLEDB driver problem.

Posted by John Sheares on Stack Overflow See other posts from Stack Overflow or by John Sheares
Published on 2010-02-17T02:37:22Z Indexed on 2010/03/14 8:05 UTC
Read the original article Hit count: 545

Filed under:
|
|

I am using VFPOLEDB driver to read DBF files and I keep getting this error and I am not sure why and how to fix the problem:

The provider could not determine the Decimal value. For example, the row was just created, the default for the Decimal column was not available, and the consumer had not yet set a new Decimal value.

Here is the code. I call this routine to return a DataSet of the DBF file and display the data in a DataGridView.

   public DataSet GetDBFData(FileInfo fi, string tbl)
    {
        using (OleDbConnection conn = new OleDbConnection(
        @"Provider=VFPOLEDB.1;Data Source=" + fi.DirectoryName + ";"))
        {
            conn.Open();
            string command = "SELECT * FROM " + tbl;
            OleDbDataAdapter da = new OleDbDataAdapter(command, conn);
            DataSet ds = new DataSet();
            da.Fill(ds);
            return ds;
        }
    }

© Stack Overflow or respective owner

Related posts about oledb

Related posts about dbf

  • Reading DBF with VFPOLEDB driver problem.

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I am using VFPOLEDB driver to read DBF files and I keep getting this error and I am not sure why and how to fix the problem: The provider could not determine the Decimal value. For example, the row was just created, the default for the Decimal column was not available, and the consumer had not yet… >>> More

  • C#+BDE+DBF problem

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I have huge problem: I have lots of .dbf files(~50000) and I need to import them into Oracle database. I open conncection like this: OleDbConnection oConn = new OleDbConnection(); OleDbCommand oCmd = new OleDbCommand(); oConn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="… >>> More

  • Packing a DBF

    as seen on Geeks with Blogs - Search for 'Geeks with Blogs'
    I thought my days of dealing with DBFs as a "production data" source were over, but HA (no such luck). I recently had to retrieve, modify and replace some data that needed to be delivered in a DBF file. Everything was fine until I realized / remembered the DBF driver does not ACTUALLY delete records… >>> More

  • Packing a DBF

    as seen on Geeks with Blogs - Search for 'Geeks with Blogs'
    I thought my days of dealing with DBFs as a "production data" source were over, but HA (no such luck). I recently had to retrieve, modify and replace some data that needed to be delivered in a DBF file. Everything was fine until I realized / remembered the DBF driver does not ACTUALLY delete records… >>> More

  • Advanced TSQL Tuning: Why Internals Knowledge Matters

    as seen on SQL Blog - Search for 'SQL Blog'
    There is much more to query tuning than reducing logical reads and adding covering nonclustered indexes.  Query tuning is not complete as soon as the query returns results quickly in the development or test environments.  In production, your query will compete for memory, CPU, locks, I/O… >>> More