Urgent - Add Column to DBF File RRS feed

  • Question

  • I am reading records from a DBF file. This works fine. But now I need to add a couple of columns and write to them. This is my connection string:


    string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=dBase III", fileInfo.Directory.FullName)

    When I use the same connection string for this code



    string.Format("ALTER TABLE {0} ADD COLUMN Notes Text", Path.GetFileNameWithoutExtension(fileInfo.Name)




    string.Format("ALTER TABLE {0} ADD COLUMN Notes v(20)", Path.GetFileNameWithoutExtension(fileInfo.Name)

    I just get:


    Syntax error in field definition.

    Is my problem really a syntax error? Or, is this just impossible? I read this:

    "Note The Microsoft Jet database engine does not support the use of ALTER TABLE, or any of the data definition language (DDL) statements, with non-Microsoft Jet databases. Use the DAO Create methods instead." here:

    I can't use DAO because the machine is 64 bit and DAO won't work.

    Can someone please give me the correct syntax? My boss needs this for a demo tomorrow.

    Please help!!!






    • Edited by MelbourneDeveloper Tuesday, September 20, 2011 4:15 AM
    • Moved by Paul Zhou Wednesday, September 21, 2011 6:48 AM (From:.NET Base Class Library)
    Tuesday, September 20, 2011 4:13 AM


All replies