How to use the udflib.c supplied in the IB V4.x examples directory.

By: Borland Staff

Abstract: How to compile the udf example shipped with the 4.x kits.

Problem:
How to compile the udf example shipped with the 4.x kits.

Solution:
NOTE:	This example is specific to Borland C++ 4.x

Setup:
The following is a hypothetical system configuration.
		
	C:IBSERVER	(the directory containing InterBase)
	C:BC4		(the directory containing C++ 4.0)
	C:UDF_TEST	(the test directory for this example)
		
Assuming the above, the following is an example of  the minimum
the PATH should include.

	PATH=C:IBSERVERBIN;%PATH%
	PATH=C:BC4BIN;%PATH%
	PATH=C:UDF_TEST;%PATH%
			
	Files that need to be copied into the "C:UDF_TEST" directory.
		
	C:IBSERVEREXAMPLESemployee.gdb
	C:IBSERVEREXAMPLESudf.sql
	C:IBSERVEREXAMPLESudflib.c 

Example:
NOTE:	All operations for this example are to be 
performed from the "C:UDF_TEST" directory.		

Step 1:
	Edit the "udflib.c" file.
	#include 
	#include 
	#include 		edits
	#include 				  |
	#include "c:ibserverincludeibase.h"	  <-------+
	#include "c:ibserverexamplesexample.h" <-------+
			
Step 2:
Define the functions in the database using command line ISQL.
	C:UDF_TEST> isql -i udf.sql
			
Step 3:
Create the new library "mygds32.lib".
	C:UDF_TEST> implib mygds32.lib [drive]:pathgds32.dll
			
Step 4:
Create the new dll "funclib.dll".
		
NOTE:	The following command should be entered on one line.
	C:UDF_TEST> bcc32 -v -a4 -DWIN32 -tWM -tWCD 
	 -efunclib.dll udflib.c mygds32.lib

Step 5:
Use the functions.

Server Response from: ETNASC03