Read DBF File in NAV 2013 R2

johannajohanna Member Posts: 369
edited 2014-09-23 in NAV Three Tier
Dear all,

I need to read dbf file in NAV 2013 R2.
I used C# class library and using DotNet variable to call the function. But, unfortunately I got error like below.
ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
I have searched and found that this issue is caused by running 32-bit driver in 64-bit environment.
So, what should I do? Any other way to read DBF file in C/AL Code?
Please help me. Thanks in advance.
Best regards,

Johanna

Comments

  • ara3nara3n Member Posts: 9,256
    What is a DBF File? Do you mean FDB file?
    NAV 2013 only runs on sql and not native server
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • vaprogvaprog Member Posts: 1,140
    The Microsoft Access dBASE Driver does not do the trick?

    As a rather dirty alternative: If you don't need any memo fields you can treat the dbf-file as a fixed length text file. Skip the header first, then Watch out for the very first character in each line. Skip the line if it is not a space character. It is used to mark deleted records. You can get the field lengths from the information in the header and by looking at the data in some text file viewer.
  • bbrownbbrown Member Posts: 3,268
    In earlier NAV versions, I've used Excel automation to read the contents of a MS Access database file. You might see if that still works.
    There are no bugs - only undocumented features.
  • johannajohanna Member Posts: 369
    Dear ara3n,
    Thank your for your response. DBF File is a Fox Pro Database File. It is not a FDB (Native Server Database) file.

    Dear vaprog,
    I could not use the Microsoft Access dBASE Driver because there is an error "Data source name not found and no default driver specified". Thank you for your suggestion to treat the dbf-file as a fixed length text file. But, in C/AL Text Variable only has length 1024. How if the data has length more than 1024?

    Dear bbrown,
    Thank you for your response. Now I try to use DB Viewer 2000 to convert DBF to XML first. With DB Viewer 2000, I can run command in command prompt to convert DBF to XML. In C/AL Code, I have successfully create automation using Windows Script Object Model to run the command prompt from Navision. But, I want to do this as recurring job in Job Queue. When I try to run the codeunit in Job Queue, there is an error like below.
    Microsoft Dynamics NAV

    Microsoft Dynamics NAV Server attempted to issue a client callback to create an Automation object: 72c24dd5-d70a-438b-8a42-98424b88afb8 (CodeUnit 50004 tes export dbf to xml). Client callbacks are not supported on Microsoft Dynamics NAV Server.
    OK
    Could you help me to solve this issue?
    Thanks in advance :D
    Best regards,

    Johanna
Sign In or Register to comment.