Highlighted
Absent Member.
Absent Member.
1667 views

[archive] Accessing api's

[Migrated content. Thread originally posted on 25 June 2004]

I am trying to use the IBM Sample DB2 programs.
I have succesfully pre-compiled one (static) and am running it under windows2000.
The Accucorp compile is successfull, but every time i run the program, I get the following error -

sqlgstrt: Program missing or inaccessible
COBOL error at 000035 in static

the run statment is "crun32 static".

The api specified is available, in the sqllib/lib directory, and I have
added the path to the api in the project setting, runtime,object file library.

Could some-one please tell me what I am doing that is incorrect or missing.

Ta muchly
0 Likes
6 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Accessing api's

Hi

if the api-library is a windows-dll than you must insert a call of the dll to load it.

example: if you want to call a api-function of kernel32.dll you must do the following in your program:

call 'kernel32.dll'.

....

call 'api' using ...
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Accessing api's

I already do a
call "sqlgstrt" using ......
and this a part of the module "dp2api.lib".
It does not seem to load the "db2api.lib" at run time.

Any suggestions etc...


Ta muchly
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Accessing api's

You cannot load a .lib file. Those are intended for linking. Look around to see if you can find a similar file with the extension .dll instead, and then load that one.

If there is no .dll, you will have to relink the runtime with the db2 sql libraries, not a big deal, but you'd be better of with some guidance, which I recommend you contact tech support to get.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Accessing api's

OK, this then leads on -

I found the .dll file and called it in the program to load it into memory. Now, when I try to call the first subroutine, I get a memory access violation. Is this to do with the way the parametrs are passed?


On another note, how do I do a re-link ?


Ta muchly.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Accessing api's

Hi g2paul,

It may be possible to set the environment varaible

DLL-CONVENTION to 0 for calling the dll with C-Convention

or

DLL-CONVENTION to 1 for calling the dll with Pascal/WINAPI-Convention

Normaly under Windows the PASCAL/WINAPI-Convnetion is used.
You must set this variable before the inital call of the dll.
Take a look into the AcuCorp-Documentation " ACUCOBOL-GT Appendices Version 6.1" in "Appendix H: Configuration File Entries" for more information about this feature
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Accessing api's

That got it working.......


Thanks.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.