none
DBF Field names RRS feed

  • Question

  • I can connect to a dbf file just fine, However, I am having difficult with fields that have a fieldname over 10 chars long. They just return a blank column.

    Select descrtiptio FROM table // works

    Select description  FROM table // does not.

    Here is my connection String.

    String connString = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = N:\\QPath\\; Extended Properties = dBase IV; User ID = ;Password = ";

    Any ideas  ??

    J


    jppnn



    • Edited by john pp nn Friday, November 6, 2015 9:35 PM
    Friday, November 6, 2015 9:33 PM

Answers

All replies

  • 'description' might be a reserved word; try to embed it in square brackets like [description]; not sure if that works for dbf; there might be another way to indicate fields.
    Saturday, November 7, 2015 11:33 AM
  • 'Description' is not a reserved keyword.

    Changing it to 'theDescript' also fails, while 'theDescrip' works fine.

    J


    jppnn


    • Edited by john pp nn Saturday, November 7, 2015 12:56 PM
    Saturday, November 7, 2015 12:55 PM
  • Frankly, Dbase IV is a bit out dated. Anyway how big is your dbf file? Can you post it somewhere for people to access.

    If you are using Access or MS SQL then I can simulate it for you. I have no tool to create Dbase IV dbf file.

    chanmm 


    chanmm

    Saturday, November 7, 2015 1:17 PM
  • Hi, Thanks for the offer but I need to keep it as dbf to keep other systems in tact.

    J


    jppnn

    Saturday, November 7, 2015 1:52 PM
  • Hi john,

    >>I am having difficult with fields that have a fieldname over 10 chars long. They just return a blank column.

    It is the limit of Dbase IV. You could read DBF file using below libraries instead.

    Using FastDBF library.
    Write a class to do it.

    Best Regards,
    Jerry


    Monday, November 9, 2015 3:20 AM