Subject | UDF Problem |
---|---|
Author | Robert F. Tulloch |
Post date | 2001-01-04T05:06:33Z |
Hi:
Just screwing around here and need some guidance. Can't find anyway to clear log on
server from workstation without sharing dir. Don't ant to do that. Want to do it
through IB. Soooo:
Error on SP
Invalid request BLR at offset 91
function CLEARIBLOG is not defined
module name or entrypoint could not be found
Statement: create procedure ClearLog
Returns(Result char(1))
as
declare variable GotIt char (1);
begin
begin
select Credit from AccessControl
into GotIt;
end
begin
Result = CLEARIBLOG(GotIt);
end
end
The External function as shown in IBConsole:
DECLARE EXTERNAL FUNCTION CLEARIBLOG
CHAR(1) CHARACTER SET NONE
RETURNS CHAR(1) CHARACTER SET NONE FREE IT
ENTRY_POINT 'ClearIbLog' MODULE_NAME 'ltUDF.dll';
ltUDF.dll is in the UDF subdir of the intebase installation, built and QuickView shows
correct entry point.
The dll
#ifdef __BUILDING_THE_DLL
#define __EXPORT_TYPE __export
#else
#define __IMPORT_TYPE __import
#endif
#include <stdio.h>
char __EXPORT_TYPE ClearIbLog(char *DidIt);
-----------------------------------------------------------------------------------
char ClearIbLog(char *DidIt)
{
String Result;
TStringList *IBLog = new TStringList();
try
{
IBLog->LoadFromFile("interbase.log");
IBLog->Clear();
IBLog->Add(" ");
IBLog->SaveToFile("interbase.log");
delete IBLog;
Result = "T";
}
catch(...)
{
delete IBLog;
Result = "F";
}
return *Result.c_str();;
}
Just screwing around here and need some guidance. Can't find anyway to clear log on
server from workstation without sharing dir. Don't ant to do that. Want to do it
through IB. Soooo:
Error on SP
Invalid request BLR at offset 91
function CLEARIBLOG is not defined
module name or entrypoint could not be found
Statement: create procedure ClearLog
Returns(Result char(1))
as
declare variable GotIt char (1);
begin
begin
select Credit from AccessControl
into GotIt;
end
begin
Result = CLEARIBLOG(GotIt);
end
end
The External function as shown in IBConsole:
DECLARE EXTERNAL FUNCTION CLEARIBLOG
CHAR(1) CHARACTER SET NONE
RETURNS CHAR(1) CHARACTER SET NONE FREE IT
ENTRY_POINT 'ClearIbLog' MODULE_NAME 'ltUDF.dll';
ltUDF.dll is in the UDF subdir of the intebase installation, built and QuickView shows
correct entry point.
The dll
#ifdef __BUILDING_THE_DLL
#define __EXPORT_TYPE __export
#else
#define __IMPORT_TYPE __import
#endif
#include <stdio.h>
char __EXPORT_TYPE ClearIbLog(char *DidIt);
-----------------------------------------------------------------------------------
char ClearIbLog(char *DidIt)
{
String Result;
TStringList *IBLog = new TStringList();
try
{
IBLog->LoadFromFile("interbase.log");
IBLog->Clear();
IBLog->Add(" ");
IBLog->SaveToFile("interbase.log");
delete IBLog;
Result = "T";
}
catch(...)
{
delete IBLog;
Result = "F";
}
return *Result.c_str();;
}