Browse Prior Art Database

Method to Help Build Database Applications that Use Dynamic Link Libraries

IP.com Disclosure Number: IPCOM000104330D
Original Publication Date: 1993-Apr-01
Included in the Prior Art Database: 2005-Mar-19
Document File: 2 page(s) / 102K

Publishing Venue

IBM

Related People

Bezviner, DE: AUTHOR

Abstract

Disclosed is a programming method that makes building Dynamic Link Libraries (DLLs) easier and less error prone. The method is particularly useful When Creating Application programs that use the OS2* Database Manager DOS WINDOWS Requestor. It involves automating the alteration of precompiler- inserted code.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Method to Help Build Database Applications that Use Dynamic Link Libraries

      Disclosed is a programming method that makes building Dynamic
Link Libraries (DLLs) easier and less error prone.  The method is
particularly useful When Creating Application programs that use the
OS2* Database Manager DOS WINDOWS Requestor.  It involves automating
the alteration of precompiler- inserted code.

      OS2 Database Manager publications recommend that some
applications, including WINDOWS and DOS WINDOWS applications, have
the following structure: Place all of the SQL statements in a
separate module, each statement, or collection of statements, in a
distinct function.  Compile and link it as a DLL.  Compile and link
the rest of the application as an EXE, and import the functions from
the DLL.

      When the DLL calls the Database Manager, information is placed
in a structure called "sqlca".  When the Database Precompiler
(SQLPREP) is run against the SQL statements in the DLL, it assumes
that there is a structure called, specifically, "sqlca", and inserts
code referencing it.  Since the DLL is separate from the application
EXE, information cannot be automatically placed into the EXEs
storage.  The task ad dressed by this disclosure is how to get the
information into the EXEs storage, rather than into the hardcoded
"sqlca" storage in the DLL.

      There are three possible solutions, each having its own
problem:  The first solution is to have the DLL copy the information
into the EXE's storage.  This requires extra instructions, thus
reducing runtime performance.  The second solution is to have the DLL
pass the EXE a pointer to the DLLs storage.  This restricts the
application from having multiple instances running simultaneously,
since the DLLs "sqlca" structure would be overwritten by subsequent
calls.  The third solution is to have the programmer change the
precompiler-inserted code prior to compiling it.  This approach
requires an extra step that the programmer must remember, and must
execute correctly.  If this step is omitted, the application will
have unexpected results, such as loops or hangs.  Thus this approach
is very error prone and user-unfriendly.

      The best solution would be one that did not require extra
instruc tions, did not restrict the application, and did not require
extra intervention.  Therefore, the solution is to automate the
alteration of the precompiler-inserted code.

      To do this the programmer must have an editor that has a global
change command, and that can be passed a sequence of instructions
when invoked.  Since the precompilation is done on OS2, and the
compilation and linkage can be done on either OS2 or DOS, the editor
must run in one of those two environments.  Following...