Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 15 total
Thread Recompiling External Modules
Mon, Mar 21 2016 6:51 AMPermanent Link

Adam Brett

Orixa Systems

I have 2 useful EDB external modules (1 to send emails, other to generate primary-keys).

I haven't used them in a while and now recompiling them I am getting a heap of errors:

"EDBString is not a Type Identifier"
"pEDBPChar is not a Type Identifier"

and similar.

Clearly I wrote the modules in pre-UNICODE times.

I could start from scratch with blank EDB modules, but could also hack my code adding the new types.

Are there any guides on what needs to change (i.e. EDBString -> String ...)?
Mon, Mar 21 2016 7:38 AMPermanent Link

Adam Brett

Orixa Systems

Sorry more questions:

I have compiled a mini-external procedure for testing using the EDB templates.

I am trying to register this module so I can use it in my DB:

CREATE MODULE "EmailSender"
PATH 'C:\EDBData\TestData\TestModule.dll'

but I am getting a message:

"The module C:\EDBData\TestData\TestModule.dll does not exist"

Although it is clearly there in the folder, and appears to have compiled fine.

Is there something I need to switch on in EDB to allow access to external modules?
Mon, Mar 21 2016 10:47 AMPermanent Link

Charles Bainbridge

Is C:\EDBData\TestData\TestModule.dll a filespec the server process can find?
Mon, Mar 21 2016 11:37 AMPermanent Link

Adam Brett

Orixa Systems

>>Is C:\EDBData\TestData\TestModule.dll a
>>filespec the server process can find?

C:\EDBData\TestData\

is the path of the active session, so I hope so. The same folder contains the EDBConfig files for the database, I think it says in the help that the DLLs should be in that folder, so that's what I have done.
Mon, Mar 21 2016 12:47 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


>I have 2 useful EDB external modules (1 to send emails, other to generate primary-keys).
>
>I haven't used them in a while and now recompiling them I am getting a heap of errors:
>
>"EDBString is not a Type Identifier"
>"pEDBPChar is not a Type Identifier"
>
>and similar.
>
>Clearly I wrote the modules in pre-UNICODE times.
>
>I could start from scratch with blank EDB modules, but could also hack my code adding the new types.
>
>Are there any guides on what needs to change (i.e. EDBString -> String ...)?

I had a similar but different problem - I was staying with non-unicode. I think one alteration was to get rid of EDBString and replace with string, and I can't remember what happened with pEDBChar - it may have become a pChar.

If you just load up the new templates and have a look it should tell you what to do.

Roy
Mon, Mar 21 2016 2:01 PMPermanent Link

Adam Brett

Orixa Systems

Thanks Roy

>>If you just load up the new templates and have a look it should tell you what to do.

I was a bit lost, so thought I would reach out, but it turned out that the easy way (at least to get as far as compilation of the dll) was just to cut & paste old methods into new templates, just as you suggest.

However now I have the simple problem that I can't register the dll in the database session to allow it to be used.

Have I missed a step?

1.Compile DLL.
2. Copy DLL into Database Config folder.
3. Run
CREATE MODULE MyModule PATH '<mysession>\<mymodule>.dll'
4. Module should then be available to be added to SQL Statements.

At step 3 I am getting the error I describe above.
Mon, Mar 21 2016 2:39 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


Its the sort of thing I do very infrequently so generally forget the stages each time Frown

good 1.Compile DLL.

good 2. Copy DLL into Database Config folder.

not so good 3. Run
CREATE MODULE MyModule PATH '<mysession>\<mymodule>.dll'

go for more along the lines of CREATE MODULE "nlhFunctions" PATH 'nlhfunctions.dll'

If its in the config path that's all you need

not yet 4. Module should then be available to be added to SQL Statements.

I think this is where you've gone adrift.

First check if the module are there - click "View Installed Modules"

If the modules are there then the functions are available for definition - ie you still have to create the functions in the database eg

CREATE FUNCTION "CLOBMerge" (IN "clob1" CLOB COLLATE "ANSI", IN "clob2" CLOB COLLATE "ANSI", IN "Mode" VARCHAR(1) COLLATE "ANSI")
RETURNS CLOB COLLATE "ANSI"
EXTERNAL NAME "nlhFunctions"
VERSION 1.00

then you can use them in SQL

Roy Lambert
Mon, Mar 21 2016 2:43 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< I was a bit lost, so thought I would reach out, but it turned out that the easy way (at least to get as far as compilation of the dll) was just to cut & paste old methods into new templates, just as you suggest. >>

Yes, that is definitely the best route.  The 2.16 breaking changes where these module changes occurred are detailed here:

http://www.elevatesoft.com/download?action=info&category=edb&type=edbvcltrial&majorversion=2&version=2.22

(scroll down to the release notes)

In general, make sure that you set the EDB_UNICODE compiler define for the external module project if you want it to be a Unicode module, otherwise do nothing and it will be an Ansi module.

<< However now I have the simple problem that I can't register the dll in the database session to allow it to be used. >>

If the module dll is located in the configuration file path, then you would simply use:

CREATE MODULE MyModule PATH '<mymodule>.dll'

and it will be found properly.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Mar 21 2016 6:48 PMPermanent Link

Adam Brett

Orixa Systems

I am still getting the same error:

CREATE MODULE "EmailSender"
PATH 'EmailSender.dll'

"ElevateDB Error #202 An error occurred with the module EmailSender (The module EmailSender.dll does not exist)"

Frown

I attach the dll to test whether there is something wrong on my machine or with the dll, if someone else could try to register it!



Attachments: EmailSender.dll
Tue, Mar 22 2016 3:35 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


Downloaded it, installed into a test database and the system recognises its there. At that point things come a bit unstuck. I don't know what functions are in there so I can't test any further.

Roy Lambert
Page 1 of 2Next Page »
Jump to Page:  1 2
Image