Menu

How to read data from a MS-ACCES table

GnuCOBOL
2022-10-13
2023-03-13
  • Eugenio Di Lorenzo

    Can anyone tell me how I can read data from a table of an MS-ACCESS database within a GnuCOBOL program?
    Maybe even without using embedded SQL statements of the type EXEC SQL xxxx END-EXEC.
    Instead, perhaps using just COBOL statements like "CALL xxxxx.

     
    • Vincent (Bryan) Coen

      On 13/10/2022 21:08, Eugenio Di Lorenzo wrote:

      Can anyone tell me how I can read data from a table of an MS-ACCESS
      database within a GnuCOBOL program?
      Maybe even without using embedded SQL statements of the type EXEC SQL
      xxxx END-EXEC.
      Instead, perhaps using just COBOL statements like "CALL xxxxx.

      If it was me, I would export the table as a comma limited file and read
      that in Cobol as a LS file where record size is larger than the max record.

      I do that in my software flightlog program to import a file of technical
      log operations for many differing a/c's to save type lots of flights etc.

      Doodle.

       
  • Eugenio Di Lorenzo

    There seems to be no guidance from anyone.
    I think it's a topic that should be of good interest.
    There are no experiences around ?

     
    • Brian Tiffin

      Brian Tiffin - 2023-03-11

      Yeah, there was once a full treatise written up on how to access Excel and Access data from OpenCOBOL, but I didn't snag the article out of the TikiWiki before Aoirthoir had to reset the hosting. Steve unlayered the docx zip and got at the inner XML. I think goes all the way back to 2015ish or before.

      And yes, there should be more articles. Well, there are a few, but need to find them.

      If this needs to be done quickly, I'd start with looking to see if sfk Swiss File Knife can't pull out the fields as filtered text and make for an easier ride. Setup a pipeline, wield it from GnuCOBOL.

      Cheers,
      Blue

       
      • Eugenio Di Lorenzo

        Hi Brian,
        this would be very important and interesting.
        When we post in this forum, we often hope to have the right information to avoid wasting time.
        If someone already has indications (and above all working examples) and shares them on the web we can invest our time on other topics and make the whole GnuCOBOL project progress even more.

        If there was any documentation for managing data in MS-Access it would be very sad if it was lost.
        Similarly very useful would be to have documentation for accessing and managing data in MS-Excel and also in the corresponding spreadsheet and database formats for LibreOffice and OpenOffice.
        I've done several web searches for GNUCOBOL and MS-ACCESS or EXCEL but find almost nothing.

         
    • thomas

      thomas - 2023-03-11

      Using ODBC you can CRUD tables on Access

       

      Last edit: thomas 2023-03-11
  • pottmi

    pottmi - 2023-03-11

    This is not my area so I may be completely off base but isn't there
    ODBC drivers that can be used with ACCESS?

    On Sat, Mar 11, 2023 at 11:53 AM Brian Tiffin
    btiffin@users.sourceforge.net wrote:

    Yeah, there was once a full treatise written up on how to access Excel and Access data from OpenCOBOL, but I didn't snag the article out of the TikiWiki before Aoirthoir had to reset the hosting. Steve unlayered the docx zip and got at the inner XML. I think goes all the way back to 2015ish or before.

    And yes, there should be more articles. Well, there are a few, but need to find them.

    If this needs to be done quickly, I'd start with looking to see if sfk Swiss File Knife can't pull out the fields as filtered text and make for an easier ride. Setup a pipeline, wield it from GnuCOBOL.

    Cheers,
    Blue


    How to read data from a MS-ACCES table


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/gnucobol/discussion/cobol/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     
  • László Erdős

    László Erdős - 2023-03-13

    Hi,

    I think, EXCEL (maybe ACCESS also) should work also with DDE:
    https://en.wikipedia.org/wiki/Dynamic_Data_Exchange

    Br.
    László

     
  • Mickey White

    Mickey White - 2023-03-13

    One way is to save the excel sheet as an xml version. Start with a small one and then look thru the xml to see the structure.
    Then read into cobol program and parse thru the file looking for the 'Cell' data.
    CRUD it. Write it out new. Upload to pc, open as excel save as excel.
    I seem to recall this is how they did it somewhere, even on the mainframe.
    That is not directly updating the Excel document, but it is a hack that seemed to work.

     

Log in to post a comment.