ODBC Drivers, Windows Eclipse, and DevHub to Linux Connection Error

I'm using Visual Cobol to access a MySQL Database.

 

I have the $SET SQL(DBMAN=ODBC) set, and I've even tried setting that in the Microfocus > Build Configurations > COBOL > SQL Preprocessor.

 

However the compiled executable from Visual Cobol, gives me the following error.

 

          OpenESQL Error: Unable to load ODBC Driver/Driver Manager. Ensure that your
     database environment is set correctly.

 

However if I compile from the Linux command line using "cob -xV Source.cbl" the executable works perfectly.

 

Its just a convenience thing, but any ideas how to get Eclipse to compile executable programs without resorting to me going to the command line every time?

 

Thanks for you help.

 

 

Eric Boatman

  • Verified Answer

    Hi Eric,

    One possible reason for this would be a disagreement between the bitism (32 vs 64) of your installed ODBC middleware, and that of the executable file you create.

    At the command line, you can check your COBOL working mode (which determines the bitism of the executable you create) with the command:
    cobmode

    The output should be a message similar to the following(showing 32 or 64 instead of XX):
    Effective Default Working Mode: XX bit

    Once you've determined this, check whether Eclipse is configured to build executables using the same bitism. This is configured within Project Properties, in the Micro Focus->Build Configurations->COBOL dialog, with the setting "Platform Target". Is there any chance that the bitism you build in Eclipse is different than what you build at the command line?

  • Thats exactly it ... Today, you are my hero ...

    Is there an easy way to default this to 64Bit with Eclipse? And am I going to regret this later?
  • Verified Answer

    Hi Eric,

    You can change the default for future Native COBOL projects that are created in Visual COBOL for Eclipse by going to Window->Preferences->Micro Focus->Builder. See the entry Default Platform Target.

    Future regret is difficult to predict :-) You can always modify the setting for individual projects in Project Properties as needed.