1. Berka Frenfert
  2. PowerBuilder
  3. Thursday, 20 June 2019 12:40 PM UTC

I need to delete some objects from some specific libraries i have found with a utility i developed in PowerBuilder but thereis no easy way i can delete objects through script.

There is ORCA which i never used before and have no idea how to use it.

I am reading the ORCA GUIDE but there is no complete example of "LibraryEntryDelet"

My utility returns me the objects location which i want to pass to the LibraryEntryDelet method to delete the objects.

Can someone help me with sample code for LibraryEntryDelet?

PB12.x

Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 20 June 2019 23:48 PM UTC
  2. PowerBuilder
  3. # Permalink

The return from SessionOpen is passed into LibraryEntryDelete and SessionClose as hORCASession. The xxx in the external functions is the PB version.

External function declarations:

Function long PBORCA_SessionOpen ( ) Library "pborcxxx.dll"

Function long PBORCA_LibraryEntryDelete ( long hORCASession, string lpszLibName, string lpszEntryName, integer otEntryType ) Library "pborcxxx.dll"

Subroutine PBORCA_SessionClose ( long hORCASession ) Library "pborcxxx.dll"

Instance variables:

// enum pborca_type
Constant Integer PBORCA_APPLICATION = 0
Constant Integer PBORCA_DATAWINDOW = 1
Constant Integer PBORCA_FUNCTION = 2
Constant Integer PBORCA_MENU = 3
Constant Integer PBORCA_QUERY = 4
Constant Integer PBORCA_STRUCTURE = 5
Constant Integer PBORCA_USEROBJECT = 6
Constant Integer PBORCA_WINDOW = 7
Constant Integer PBORCA_PIPELINE = 8
Constant Integer PBORCA_PROJECT = 9
Constant Integer PBORCA_PROXYOBJECT = 10
Constant Integer PBORCA_BINARY = 11

// error codes
Constant Long PBORCA_OK = 0 // Operation successful
Constant Long PBORCA_INVALIDPARMS = -1 // Invalid parameter list
Constant Long PBORCA_DUPOPERATION = -2 // Duplicate operation
Constant Long PBORCA_OBJNOTFOUND = -3 // Object not found
Constant Long PBORCA_BADLIBRARY = -4 // Bad library name
Constant Long PBORCA_LIBLISTNOTSET = -5 // Library list not set
Constant Long PBORCA_LIBNOTINLIST = -6 // Library not in lib list
Constant Long PBORCA_LIBIOERROR = -7 // Library I/O error
Constant Long PBORCA_OBJEXISTS = -8 // Object exists
Constant Long PBORCA_INVALIDNAME = -9 // Invalid name
Constant Long PBORCA_BUFFERTOOSMALL = -10 // Buffer size is too small
Constant Long PBORCA_COMPERROR = -11 // Compile error
Constant Long PBORCA_LINKERROR = -12 // Link error
Constant Long PBORCA_CURRAPPLNOTSET = -13 // Current appl not set
Constant Long PBORCA_OBJHASNOANCS = -14 // Object has no ancestors
Constant Long PBORCA_OBJHASNOREFS = -15 // Object has no references
Constant Long PBORCA_PBDCOUNTERROR = -16 // Invalid # of PBD's
Constant Long PBORCA_PBDCREATERROR = -17 // PBD create error
Constant Long PBORCA_CHECKOUTERROR = -18 // check out/in error
Constant Long PBORCA_CBCREATEERROR = -19 // component builder create error
Constant Long PBORCA_CBINITERROR = -20 // component builder init error
Constant Long PBORCA_CBBUILDERROR = -21 // component builder build error
Constant Long PBORCA_SCCFAILURE = -22 // Scc operation Failed
Constant Long PBORCA_REGREADERROR = -23 // Error reading Registry for Scc provider
Constant Long PBORCA_LOADDLLFAILED = -24 // LoadLibrary for Scc provider failed
Constant Long PBORCA_SCCINITFAILED = -25 // Scc Initialize failed
Constant Long PBORCA_OPENPROJFAILED = -26 // Scc Open Project failed
Constant Long PBORCA_TARGETNOTFOUND = -27 // Target File not found: %s
Constant Long PBORCA_TARGETREADERR = -28 // Unable to read Target File %s
Constant Long PBORCA_GETINTERFACEERROR = -29 // Unable to access required PowerBuilder interface
Constant Long PBORCA_IMPORTONLY_REQ = -30 // Scc connect offline requires IMPORTONLY refresh option
Constant Long PBORCA_GETCONNECT_REQ = -31 // Scc connect offline requires GetConnectProperties with Exclude_Checkout
Constant Long PBORCA_PBCFILE_REQ = -32 // Scc connect offline with Exclude_Checkout requires PKC file
Constant Long PBORCA_DBCSERROR = -33 // Locale setting error when convert unicode to ANSI_DBCS

 

 

 

Comment
  1. Berka Frenfert
  2. Saturday, 22 June 2019 07:11 AM UTC
Thank you Roland.
  1. Helpful
  1. Berka Frenfert
  2. Tuesday, 25 June 2019 07:32 AM UTC
Following opens command prompt with error message "Error checking out a SySAM license." and a 0 is displayed in messagebox.



ORCASAS = PBORCA_SessionOpen()

MessageBox("PBORCA_SessionOpen",ORCASAS)



Look like the C:\Program Files (x86)\Sybase\Shared\PowerBuilder\PBORC125.DLL does not have proper license. Or what else could be the reason?

  1. Helpful
  1. Roland Smith
  2. Tuesday, 25 June 2019 10:08 AM UTC
For versions of PowerBuilder that use SySAM (11 - 12.6) you must have a licensed copy of the IDE on the computer that you run a program using the ORCA functions.
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.