Page 1 of 1

[SOLVED]; ocilibw.dll;

Posted: Thu May 28, 2015 12:43 pm
by HanPBF
Sorry, finally solved; I made an error by initializing by 1st method then connecting by 2nd...


Hello!

I have a problem using ocilibw.dll vs. using libocilibw.a.

The code I used so far is like the following one:

Code: Select all

import "D:\LIB\OCILIB\lib32\libocilibw.a"
  OCI_Initialize(*ErrorHandler, *LibPath, Mode) 						as "_OCI_Initialize@12"
  OCI_ConnectionCreate(Database$, User$, Password$, Mode) 	as "_OCI_ConnectionCreate@16" 
  ; ... other procedures
endImport
With this code calling initialize and connectionCreate does work; db can be reached.

Now I need to distribute the ocilibw.dll to the client which I do by
1. copying and
2. as fallback writing includebinary dll into file system at users site

For access to the ocilibw.dll I use the following code which shall do the same as above given code:

Code: Select all

OCILibrary = OpenLibrary(#PB_Any, "ocilibw.dll")
prototype initializeOCIPrototype(*ErrorHandler, *LibPath, Mode)
prototype connectionCreateOCIPrototype(Database$, User$, Password$, Mode)

global initializeOCI	.initializeOCIPrototype = GetFunction(OCILibrary, "_OCI_Initialize@12")
global connectionCreateOCI.connectionCreateOCIPrototype	= GetFunction(OCILibrary, "_OCI_ConnectionCreate@16")
Calling these functions with the same parameters seem
- to work for initialize but
- not to work for connectionCreate which results in 0

Is the declaration and using GetFunction in second code example the correct way to access the OCI.dll?


Thanks in advance,
regards!