Visual Basic Globals:EDAGLOB.BAS

The globals in the EDAGLOB.BAS include file are required for a Visual Basic program. The EDAGLOB.BAS file may be found in the etc directory of EDAHOME.

Note: The method declarations should reflect the API DLL being used. For the Connector Suite this is the API.


Top of page

Example: Globals Required for a Visual Basic Program

Attribute VB_Name = "EDAGLOB"
'--------------------------------------------------------------
' Name: EDAGLOB.BAS
' Description: Microsoft Visual Basic iWay API header file
' Notes: Add this file as a module in your VB project.
' EID is really a pointer, but is handled as
' long, which is ok for our purposes on Windows.
'
' Copyright 2004, iWay Software / Information Builders, Inc.
' Two Penn Plaza
' New York, New York, 10121, U.S.A.
' All rights reserved worldwide.
'--------------------------------------------------------------

'----------------------------- Result Codes-------------------------
' Following the execution of a function call, the relevant result
' code will be either zero (successful completion), negative (error), or
' positive (successful with some qualification).

Global Const EDA_SUCCESS = 0 ' Successful function execution

' Warnings
Global Const EDA_FIELD_NOT_FOUND = 1 ' No description found for specified field (eda_info(1))
Global Const EDA_NO_FIELD_INFO = 2 ' No field descriptions for this table (EDAINFO/EDANULL)
Global Const EDA_BREAK_OCCURRED = 3 ' Control returned via EDABREAK command
Global Const EDA_TRUNCATED = 4 ' Field truncated, receiving field too small (EDAFETCH/EDAFIELD)
Global Const EDA_END_OF_SET = 5 ' End of set indicator (EDAFETCH/EDANEXT)
Global Const EDA_TIMEOUT = 6 ' Timeout (EDAWAIT)
Global Const EDA_NO_MORE_ANSWER_SETS = 7 ' No more answer sets (EDAQUIT)
Global Const EDA_FIELD_OVERFLOW = 8 ' Server field overflowed
Global Const EDA_STILL_EXECUTING = 9 ' Fctn not complete in nonblock mode
Global Const EDA_TRACE_INIT_FAIL = 10 ' Default trace initialization failure

' EDA context and SCB errors
Global Const EDA_INVALID_EID = -1 ' Invalid context
Global Const EDA_TOO_MANY_CONTEXTS = -2 ' Too many EDA contexts
Global Const EDA_INVALID_SID = -3 ' Invalid sid
Global Const EDA_TOO_MANY_SCBS = -4 ' Too many scbs allocated
Global Const EDA_SCB_NOT_INIT = -5 ' The scb is not initialized
Global Const EDA_SCB_INIT = -6 ' The scb is initialized

' EDALINK errors
Global Const EDA_INIT_EDANET_ERROR = -7 ' Cannot initialize EDALINK
Global Const EDA_CLOSE_EDANET_ERROR = -8 ' Cannot close down EDALINK
Global Const EDA_CONNECT_ERROR = -9 ' Error connecting to server
Global Const EDA_DISCONNECT_ERROR = -10 ' Error disconnecting from server
Global Const EDA_DATA_SEND_ERROR = -11 ' Error sending data to server
Global Const EDA_DATA_RECEIVE_ERROR = -12 ' Error receiving data from server

' General errors
Global Const EDA_INVALID_OPERATION = -13 ' Operation not permitted in current context
Global Const EDA_MEMORY_OVERFLOW = -14 ' Insufficient memory available
Global Const EDA_BAD_PARM_VAL = -15 ' Invalid parameter value
Global Const EDA_TUPLE_MISALIGNED = -16 ' Tuple alignment error (EDAFETCH/EDAFIELD)
Global Const EDA_ACCESS_DENIED = -17 ' Userid/Password invalid
Global Const EDA_INTERNAL_API_ERROR = -18 ' Unexplained internal EDA API malfunction
Global Const EDA_UNAVAILABLE_FUNCTION = -19 ' Not supported at this API level

Global Const EDA_PASSWORD_EXPIRED = -20 ' Password expired
Global Const EDA_INVALID_NEW_PASWORD = -21 ' Invalid new password
Global Const EDA_ENCRYPTION_VERSION_MISMATCH = -22 'Encryption version mismatch
Global Const EDA_CONNECTION_NO_LONGER_VALID = -23 'Connection no longer valid
Global Const EDA_INVALID_CODE_PAGE = -24 ' Invalid server code page
Global Const EDA_EXECUTE_NOT_PREPARED = -25 ' Statement not prepared

Global Const EDA_INVALID_SERVER = -26 ' EDACONNECT to unk server
Global Const EDA_INVALID_STATEMENT = -27 ' SERVER rejected statement
Global Const EDA_INVALID_MSG_UOW = -28
Global Const EDA_INVALID_MSG_ATT = -29
Global Const EDA_INVALID_PROTOCOL = -30
Global Const EDA_INVALID_MSG_COMMITERR = -31

Global Const EDA_USERID_IN_USE = -32
Global Const EDA_RESOURCE_LIMIT = -33
Global Const EDA_COMM_TIMEOUT = -34 ' communications timed out
Global Const EDA_BAD_USERID = -35 ' security violation
Global Const EDA_REVOKED_USERID = -36 ' security violation
Global Const EDA_SRV_COMM_FAIL = -37 ' server reports comm error
Global Const EDA_INVALID_LICENSE = -38 ' server reports invalid license
Global Const EDA_INVALID_METADATA = -39 ' metadata is corrupt
Global Const EDA_INVALID_SERVICE = -40 ' 46981 service at server issue
Global Const EDA_API_MAX_ERROR = -40 ' Max negative error code
Global Const EDA_API_MAX_WARNING = 10 ' Max positive warning code


' /********************* Callback types ***********************/
' /*----------------------------------------------------------*/
' /* callback types used to establish the callback in */
' /* EDACALLBACK(), and filled into the callback block when */
' /* the callback routine is called by EDA. */
' /* Note: LOCK and UNLOCK do NOT have callback blocks. */
' /* p26084 - add NOTIFY callback for transmission block */
' /*----------------------------------------------------------*/

Global Const EDA_CB_TRACE = 0 ' trace callback routine
Global Const EDA_CB_MEMORY = 1 ' memory callback routine

Global Const EDA_CB_M_ALLOC = 2 ' memory type to allocate
Global Const EDA_CB_M_FREE = 3 ' memory type to deallocate
Global Const EDA_CB_M_RESIZE = 4 ' memory type to request resize

Global Const EDA_CB_LOCK = 2 ' NOT SUPPORTED
Global Const EDA_CB_UNLOCK = 3 ' NOT SUPPORTED
Global Const EDA_CB_MESSAGE = 4 ' scan messages received
Global Const EDA_CB_NOTIFY = 5 ' conditions requiring poss. action
Global Const EDA_CB_MASFILE = 6 ' 32461 add a callback for masters
Global Const EDA_CB_IOCOMPLETE = 7 ' 32765 add a callback for IO msg

' Direction codes for notify callback (0=not comm)
Global Const EDA_COMMCBRECEIVE = 1
Global Const EDA_COMMCBSEND = 2

' Return codes for notify callback */
Global Const EDA_CBFAIL = 0
Global Const EDA_CBCONTINUE = 1
Global Const EDA_CBRETRY = 2

' Variable settings
Global Const VAR_RESET_SLIM = -1

Global Const EDA_VAR_USE_NULL = -3
Global Const EDA_VAR_BLOB_TP = -4
Global Const EDA_VAR_SET = 1
Global Const EDA_VAR_RESET = 0

Global Const EDA_VAR_ON = 1
Global Const EDA_VAR_OFF = 0

Global Const EDA_VAR_ENGINE = 0
Global Const EDA_VAR_FORMAT = 1
Global Const EDA_VAR_MAJOR = 2
Global Const EDA_VAR_MINOR = 3
Global Const EDA_VAR_RESERVED04 = 4
Global Const EDA_VAR_TRACE = 5
Global Const EDA_VAR_TRACE_LVL1 = 6
Global Const EDA_VAR_TRACE_LVL2 = 7
Global Const EDA_VAR_TRACE_LVL3 = 8
Global Const EDA_VAR_TRACE_LVL4 = 9
Global Const EDA_VAR_TRACE_LVL5 = 12272
Global Const EDA_VAR_TRACE_LVL6 = 12273
Global Const EDA_VAR_TRACE_LVL7 = 12274
Global Const EDA_VAR_TRACE_LVL8 = 12275
Global Const EDA_VAR_TRACE_LVL9 = 12276
Global Const EDA_VAR_ODIN_LVL1 = 12277
Global Const EDA_VAR_ODIN_LVL2 = 12278
Global Const EDA_VAR_ODIN_LVL3 = 12279
Global Const EDA_VAR_ODIN_LVL4 = 12280
Global Const EDA_VAR_ODIN_LVL5 = 12281
Global Const EDA_VAR_TRACE_DEF = 12282
Global Const EDA_VAR_READLIMIT = 10
Global Const EDA_VAR_RECLIMIT = 11
Global Const EDA_VAR_ALL = 12
Global Const EDA_VAR_SMARTMODE = 13
Global Const EDA_VAR_QDEPTH = 14
Global Const EDA_VAR_AUTOPURGE = 15
Global Const EDA_VAR_AUTOCOMMIT = 16
Global Const EDA_VAR_ACCESSMODE = 17
Global Const EDA_VAR_SERVERCOUNT = 18
Global Const EDA_VAR_QUIT_ALL = 19
Global Const EDA_VAR_HARD_DISCONNECT = 20
Global Const EDA_VAR_RESERVED21 = 21
Global Const EDA_VAR_SLIM_VALUE = 22
Global Const EDA_VAR_RESERVED23 = 23
Global Const EDA_VAR_RESERVED24 = 24
Global Const EDA_VAR_RESERVED25 = 25
Global Const EDA_VAR_ATT_NAME = 26
Global Const EDA_VAR_ATT_CLASS = 27
Global Const EDA_VAR_PREALLOC = 28
Global Const EDA_VAR_QUIT_BREAK = 29
Global Const EDA_VAR_SERVER_NAME = 30
Global Const EDA_VAR_NODE_INFO = 31
Global Const EDA_VAR_HOLD_FILE = 32
Global Const EDA_VAR_AS_FILE = 33
Global Const EDA_VAR_IWAY_FOUND = 34
Global Const EDA_VAR_IWAY_PATH = 35
Global Const EDA_VAR_STEP = 36
Global Const EDA_VAR_MSGLIST = 37

Global Const EDA_VAR_ALIGN4 = 120
Global Const EDA_VAR_ALIGN8 = 121
Global Const EDA_VAR_XRETRIEVE = 122
Global Const EDA_VAR_CDNOTATION = 123
Global Const EDA_VAR_DBCSCHECK = 124
Global Const EDA_VAR_SERVEMAJOR = 125
Global Const EDA_VAR_SERVEMINOR = 126
Global Const EDA_VAR_NO_MPLEX = 127
Global Const EDA_VAR_FULLDUPLEX = 128
Global Const EDA_VAR_QUERY_ID = 129
Global Const EDA_VAR_SUBQUERY_ID = 130
Global Const EDA_VAR_RESERVED131 = 131
Global Const EDA_VAR_NO_CATALOG = 132
Global Const EDA_VAR_RESERVED133 = 133
Global Const EDA_VAR_SERVICE_NAME = 134
Global Const EDA_VAR_RESERVED135 = 135
Global Const EDA_VAR_DEFAULT_ENGINE = 136
Global Const EDA_VAR_ENGINE_REL = 137
Global Const EDA_VAR_RESERVED138 = 138
Global Const EDA_VAR_NOFILTER_MSGS = 139
Global Const EDA_VAR_STARTUP = 140
Global Const EDA_VAR_CLOSEDOWN = 141
Global Const EDA_VAR_COMM_ID = 142 ' Internal IBI use only
Global Const EDA_VAR_SESS_ID = 143 ' Internal IBI use only
Global Const EDA_VAR_SERVER_ID = 144 ' Internal IBI use only
Global Const EDA_VAR_SESSION_ID = 145 ' Internal IBI use only
Global Const EDA_VAR_RESERVED146 = 146
Global Const EDA_VAR_NO_FRAGMENT = 147
Global Const EDA_VAR_COLINFO_PTR = 148
Global Const EDA_VAR_COLINFO_SIZE = 149
Global Const EDA_VAR_SCBTYPE = 150
Global Const EDA_VAR_STATE_TRACE = 151
Global Const EDA_VAR_NOSIGVER = 152
Global Const EDA_VAR_LOG = 153
Global Const EDA_VAR_RCVTIME = 154
Global Const EDA_VAR_LOGID = 155
Global Const EDA_VAR_LINKID = 156
Global Const EDA_VAR_LINKHDL = 157
Global Const EDA_VAR_USER_AREA = 158
Global Const EDA_VAR_PASSIVE = 159 ' set connection passive
Global Const EDA_VAR_CAN_PASSIVATE = 160 ' connection allows passivating
Global Const EDA_VAR_EXTENDSEC = 161 ' extend security
Global Const EDA_VAR_XASWITCH = 162 ' X/Open Group RM
Global Const EDA_VAR_NLSCTX = 163 ' 42967 ODBC requires this

Global Const EDA_VAR_SWAPLL = 300 ' swaps llidf.ll based on hardware
Global Const EDA_VAR_ASYCTL = 301 ' Sets EDA_ASYCTL
Global Const EDA_VAR_ASYCMNT = 302 ' Sets ASY comment
Global Const EDA_VAR_ASYID = 303 ' Gets last uowid
Global Const EDA_VAR_NO_BLOCK = 304 ' Force 'sync' on prepares
Global Const EDA_VAR_AUTOLOCK = 305 ' thread safety support
Global Const EDA_VAR_CTX = 306 ' Internal IBI use only
Global Const EDA_VAR_R1H = 307 ' Internal IBI use only
Global Const EDA_VAR_NODTRC = 308 ' Internal IBI use only
Global Const EDA_VAR_R1SYNC = 309 ' Internal IBI use only
Global Const EDA_VAR_NON_CLIENT = 310 ' Internal IBI use only
Global Const EDA_VAR_PK_PROD = 311 ' Internal IBI use only
Global Const EDA_VAR_REMOTE_GATEWAY = 312 ' 42765 internal use only

Global Const EDA_PK_ODBC = 1 ' 40107 internal use only
Global Const EDA_PK_ACTX = 2 ' 40107 internal use only
Global Const EDA_PK_OLEDB = 3 ' 40107 internal use only
Global Const EDA_VAR_PKPROD_MAX = 3 ' 40107 internal use only

Global Const EDA_VAR_MAX_PUSET = "0xffff" ' initial value



' Engine variable settings
Global Const EDA_VAR_ENGINE_STANDARD = 0
Global Const EDA_VAR_ENGINE_DB2 = 1
Global Const EDA_VAR_ENGINE_ORACLE = 2
Global Const EDA_VAR_ENGINE_TERADATA = 3
Global Const EDA_VAR_ENGINE_SQLDS = 4
Global Const EDA_VAR_ENGINE_SHAREBASE = 5
Global Const EDA_VAR_ENGINE_SQLMSS = 6
Global Const EDA_VAR_ENGINE_SUPRA = 7
Global Const EDA_VAR_ENGINE_INGRES = 8
Global Const EDA_VAR_ENGINE_SYBASE = 9
Global Const EDA_VAR_ENGINE_RDB = 10
Global Const EDA_VAR_ENGINE_INFORMIX = 11
Global Const EDA_VAR_ENGINE_UNIFY = 12
Global Const EDA_VAR_ENGINE_SQLEDA = 13
Global Const EDA_VAR_ENGINE_OS2EE = 14
Global Const EDA_VAR_ENGINE_SQL400 = 15
Global Const EDA_VAR_ENGINE_NONSTOP = 16
Global Const EDA_VAR_ENGINE_ALLBASE = 17
Global Const EDA_VAR_ENGINE_PROGRESS = 18
Global Const EDA_VAR_ENGINE_REDBRICK = 19
Global Const EDA_VAR_ENGINE_UNIVERSE = 20
Global Const EDA_VAR_ENGINE_DATACOM = 21
Global Const EDA_VAR_ENGINE_INFOACC = 22
Global Const EDA_VAR_ENGINE_SQLIDMS = 23
Global Const EDA_VAR_ENGINE_STORHOUSE = 24
Global Const EDA_VAR_ENGINE_ODBC = 25
Global Const EDA_VAR_ENGINE_MSQ = 26
Global Const EDA_VAR_ENGINE_NUCLEUS = 27
Global Const EDA_VAR_ENGINE_MSACCESS = 28
Global Const EDA_VAR_ENGINE_MYSQL = 29
Global Const EDA_VAR_ENGINE_MAX = 29

' Format settings
Global Const EDA_VAR_FORMAT_ALPHA = 0
Global Const EDA_VAR_FORMAT_DIF = 1
Global Const EDA_VAR_FORMAT_LOTUS = 2
Global Const EDA_VAR_FORMAT_SYLK = 3
Global Const EDA_VAR_FORMAT_IXF = 4
Global Const EDA_VAR_FORMAT_HTML = 5
Global Const EDA_VAR_FORMAT_EXCEL = 6
Global Const EDA_VAR_FORMAT_WP = 7
Global Const EDA_VAR_FORMAT_DOC = 8
Global Const EDA_VAR_FORMAT_BINARY = 9
Global Const EDA_VAR_FORMAT_POSTSC = 10
Global Const EDA_VAR_FORMAT_PS = 11
Global Const EDA_VAR_FORMAT_HTMTAB = 12
Global Const EDA_VAR_FORMAT_COMMA = 13
Global Const EDA_VAR_FORMAT_GIF = 14
Global Const EDA_VAR_FORMAT_BMP = 15
Global Const EDA_VAR_FORMAT_FXF = 16
Global Const EDA_VAR_FORMAT_VIEWER = 17
Global Const EDA_VAR_FORMAT_CLIP = 18
Global Const EDA_VAR_FORMAT_RTF = 19
Global Const EDA_VAR_FORMAT_PDF = 20
Global Const EDA_VAR_FORMAT_EXL4 = 21
Global Const EDA_VAR_FORMAT_EXL2K = 22
Global Const EDA_VAR_FORMAT_NOTES = 23

' All Settings
Global Const EDA_VAR_ALL_STANDARD = 0
Global Const EDA_VAR_ALL_ON = 1
Global Const EDA_VAR_ALL_PASS = 2
Global Const EDA_MAX_SERVER_LEN = 8

' maximum size for array of set values passed to EDAPINIT
Global Const EDA_MAX_PINIT = 32

' Special setting for null-deliminated parameters
Global Const EDA_NULL_DELIM = -1

' Data type codes
Global Const EDA_NO_TYPE_CODE = 0
Global Const EDA_I_TYPE_CODE = 1
Global Const EDA_F_TYPE_CODE = 2
Global Const EDA_D_TYPE_CODE = 3
Global Const EDA_P_TYPE_CODE = 4
Global Const EDA_A_TYPE_CODE = 5
Global Const EDA_B_TYPE_CODE = 6
Global Const EDA_DATE_TYPE_CODE = 7
Global Const EDA_T_TYPE_CODE = 8
Global Const EDA_K_TYPE_CODE = 9
Global Const EDA_BLOB_TYPE_CODE = 10
Global Const EDA_CLOB_TYPE_CODE = 11
Global Const EDA_ULOB_TYPE_CODE = 12
Global Const EDA_TIME_TYPE_CODE = 13
Global Const EDA_TSTMP_TYPE_CODE = 14
Global Const EDA_V_TYPE_CODE = 15

Global Const EDA_MAX_TYPE_CODE = 15
Global Const EDA_DEFAULT_BUFFERSIZE = 1024
Global Const EDA_UNKNOWN_BLOB_LENGTH = 0

' EDA Fetch types
Global Const EDA_BINARY = 0
Global Const EDA_ALPHANUM = 1

' EDA Null types
Global Const EDA_CAN_BE_NULL = 1
Global Const EDA_CANNOT_BE_NULL = 0
Global Const EDA_IS_NULL = 1
Global Const EDA_IS_NOT_NULL = 0

' Using
Global Const EDA_ADD_PARM = 0
Global Const EDA_END_PARM_LIST = 1
Global Const EDA_CANCEL_PARM_LIST = 2
Global Const EDA_CANCEL_ALL_PARMS = 3
' Commit
Global Const EDA_COMMIT = 1
Global Const EDA_ROLLBACK = 0
Global Const XAPREPARE = 2
Global Const XACOMMIT = 3
Global Const XAROLLBACK = 4
Global Const XARECOVER = 5

' Internal Lock Controls
Global Const EDA_LOCK_UNLOCK = 0 'unlock this resource
Global Const EDA_LOCK_LOCK = 1 'lock this resource

' Value codes that can appear in colInfo follow
Global Const EDA_COLINFO_AVAIL = 0 ' data available, length known
Global Const EDA_COLINFO_NULL = EDA_IS_NULL ' data in column is NULL
Global Const EDA_COLINFO_BLOB = 2 ' data available, length unknown
Global Const EDA_COLINFO_ERR = 3 ' unable to compute available
Global Const EDA_COLINFO_OFLO = EDA_FIELD_OVERFLOW ' value overflow

' EDA connection codes (last parm on EDACONNECT())
Global Const EDA_CONNECT_DEFAULT = 0 ' take first sync server
Global Const EDA_CONNECT_SEMIPLEX = -4 ' subordinate scb
Global Const EDA_CONNECT_SELF = -5 ' API/SQL as a data base
Global Const EDA_CONNECT_PEER = -6 ' reverse peer server
Global Const EDA_CONNECT_URL = -7 ' on the fly

' scbtypes returned from inspect of EDA_VAR_SCBTYPE
Global Const EDA_SCBTYPE_UNKNOWN = -1 ' CLASS is not an EDA type
Global Const EDA_SCBTYPE_SYNC = 1 ' synchronous server
Global Const EDA_SCBTYPE_ASYNC = 2 ' asynchronous server
Global Const EDA_SCBTYPE_SELF = 3 ' local EDABASE scb
Global Const EDA_SCBTYPE_ASERV = 4 ' asynchronous executor
Global Const EDA_SCBTYPE_LOCAL = 5 ' local server
Global Const EDA_SCBTYPE_PEER = 6 ' reverse channel
Global Const EDA_SCBTYPE_TP = 7 ' transaction processor
Global Const EDA_SCBTYPE_DIST = 8 ' distributor node
Global Const EDA_SCBTYPE_CLUSTER = 8 ' cluster control node

' commands to EDABROWSE
Global Const EDABASE_SELECT = 0 'also if cmd=NULL
Global Const EDABASE_DELETE = 1

' EDABROWSE table identifiers
Global Const EDABASE_TBL_ENGINES = 1
Global Const EDABASE_SEL_ENGINES_ALL = 0 ' all engines, also if selector=NULL
Global Const EDABASE_SEL_ENGINES_NAME = 1
Global Const EDABASE_SEL_ENGINES_TYPE = 2

Global Const EDABASE_TBL_SERVERS = 2
Global Const EDABASE_SEL_SERVERS_NOFILTER = 0
Global Const EDABASE_SEL_SERVERS_SYNC = 1
Global Const EDABASE_SEL_SERVERS_ASYNC = 2
Global Const EDABASE_SEL_SERVERS_ALL = EDABASE_SEL_SERVERS_SYNC
Global Const EDABASE_SEL_SERVERS_EXACT = 4
Global Const EDABASE_SEL_SERVERS_DEFAULT = 8
Global Const EDABASE_SEL_SERVERS_NOINTERL = 16
Global Const EDABASE_SEL_SERVERS_ODBC_ONLY = 32
Global Const EDABASE_TBL_ERRORS = 3
Global Const EDABASE_SEL_ERRORS_ALL = 0
Global Const EDABASE_SEL_ERRORS_CODE = 1
Global Const EDABASE_TBL_MSGS = 4
Global Const EDABASE_SEL_MSGS_ALL = 0
Global Const EDABASE_SEL_MSGS_UOWID = 1 ' action select by ID of UOW
Global Const EDABASE_SEL_MSGS_HUOW = 2 ' action select by handle to UOW
Global Const EDABASE_TBL_TABLES = 5
Global Const EDABASE_SEL_TABLES_ALL = 0

' EDASQL Execute flags
Global Const EDA_EXECUTE_BUILD = 0
Global Const EDA_EXECUTE_EXECUTE = 1
Global Const EDA_EXECUTE_CANCEL = 2
Global Const EDA_EXECUTE_ALOB = 4

' Order of the fields returned by browse/engines
Global Const EDA_BENG_FLD_NAME = 1
Global Const EDA_BENG_FLD_CODE = 2

' Order of the fields returned by browse/servers
Global Const EDA_BSRV_FLD_NAME = 1
Global Const EDA_BSRV_FLD_CODE = 2
Global Const EDA_BSRV_FLD_PARTNER = 3
Global Const EDA_BSRV_FLD_INTERNAL = 4

' Order of the fields returned by browse/errors
Global Const EDA_BERR_FLD_CODE = 1
Global Const EDA_BERR_FLD_TEXT = 2

' Order of the fields returned by browse/messages
Global Const EDA_BMSG_FLD_UOWID = 1
Global Const EDA_BMSG_FLD_USERID = 2
Global Const EDA_BMSG_FLD_STATE = 3
Global Const EDA_BMSG_FLD_ASRC = 4
Global Const EDA_BMSG_FLD_TARGRC = 5
Global Const EDA_BMSG_FLD_ERRORBY = 6
Global Const EDA_BMSG_FLD_SENTSTAMP = 7
Global Const EDA_BMSG_FLD_PROCSTAMP = 8
Global Const EDA_BMSG_FLD_MODULE = 9
Global Const EDA_BMSG_FLD_REQUEST = 10
Global Const EDA_BMSG_FLD_CONTENT = 11 ' Result set

' Until new messaging replaces old
Global Const EDA_BMSG_FLD_ENTRY = 16
Global Const EDA_BMSG_FLD_COMMENT = 17
Global Const EDA_BMSG_FLD_USERDATA = 18
Global Const EDA_BMSG_FLD_MSGID = 19
Global Const EDA_BMSG_FLD_PRIORITY = 20
Global Const EDA_BMSG_FLD_CLASS = 21
Global Const EDA_BMSG_FLD_CLASSTYPE = 22

' Message states
Global Const EDA_UOWSTATE_CONFIRM = 1
Global Const EDA_UOWSTATE_FAILED = 2
Global Const EDA_UOWSTATE_INDOUBT = 3
Global Const EDA_UOWSTATE_TIMEDOUT = 4

' Codes in messaging MsgRC
Global Const EDA_MSGRC_TIMEOUT = 1
Global Const EDA_MSGRC_NODEM = 2
Global Const EDA_MSGRC_NOENTRY = 3
Global Const EDA_MSGRC_TARGET = 4
Global Const EDA_MSGRC_PROTOCOL = 5

' Message Component Type
Global Const EDA_MSGTYPE_QUERY = 1 'Content is a CLOB with the query
Global Const EDA_MSGTYPE_RESPONSE = 2 'Content is an ALOB based answer set
Global Const EDA_MSGTYPE_USER = 256 'Base of user message types


' /*----------------------------------------------------------*/
' /* Message states */
' /*----------------------------------------------------------*/

Global Const EDA_MSGSTATE_SENT = "0x00"
Global Const EDA_MSGSTATE_INDOUBT = "0x01"
Global Const EDA_MSGSTATE_EXPIRED = "0x02"
Global Const EDA_MSGSTATE_COMPLETE = "0x03" ' /* reply received */
Global Const EDA_MSGSTATE_FAILED = "0x04" ' /* reply received (ie no such DEM) */

' EDATXCTL structure CREATE codes
Global Const EDA_TX_ASYCTL = 1 ' /* create an EDA message stream */
Global Const EDA_TX_ASYATTCTL = 2 ' /* open another message stream */
Global Const EDA_TX_ASYRSETUP = 3 ' /* initiate reply capability (first) */
Global Const EDA_TX_ASYREPLY = 4 ' /* prepare a reply to existing UOW */
' /* pStructure -> incoming huow */
Global Const EDA_TX_ASYDUPLICATE = 5 ' /* exact copy an attachment */
Global Const EDA_TX_SYNC = 9 ' /* do a SYNC operation */

' EDATXCTL structure COMPLETE codes

Global Const EDA_TXCTL_COMMIT = 7 ' /* commit a new UOW */
Global Const EDA_TXCTL_CONFIRM = 8 ' /* confirm a UOW reply */
Global Const EDA_TXCTL_ABORT = 9 ' /* abort a UOW reply (partway done) */
Global Const EDA_TXCTL_FAIL = 10 ' /* fail a UOW reply (can't do ) */
Global Const EDA_TXCTL_RETRY = 11 ' /* please reschedule this UOW */

' EDATXCTL structure POST codes
Global Const EDA_TXCTL_ERROR = 1 ' /* post an error to this UOW */

' EDATXCTL command codes */
Global Const EDA_TXCTL_CREATE = 1 ' /* creates uow or att */
Global Const EDA_TXCTL_COMPLETE = 2 ' /* take final action */
Global Const EDA_TXCTL_POST = 3 ' /* take general action */
Global Const EDA_TXCTL_CANCEL = 4 ' /* quit from separate thread */


' Asynchronous messaging information structure
Type s_estamp
year As Long
month As Long
day As Long
hour As Long
minute As Long
second As Long
fraction As Long
End Type

Type s_edaasyx
size As Long ' fill with sizeof(EDA_ASYCTL) before call
hStream As Long ' returned by EDA
classType As Long ' MSGTYPE of this attachment
priority As Long ' priority of this message
timeout As Long
szClass As String * 36 ' name of this class, max 32 char
szModule As String * 36
szEntry As String * 36
szComment As String * 120 ' comment to appear in browse listings
abUser As String * 128 ' user-specific information
End Type
 
Type s_edaasya
size As Long ' fill in with sizeof(EDA_ASYCTL) before call
hStream As Long ' returned by EDA
classType As Long ' MSGTYPE of this attachment
szClass As String * 36 ' name of this class 32 char meaningful
End Type

Type s_edaasyerr
size As Long ' fill in with sizeof(EDA_ASYCTL) before call
errclass As Long ' which error is being posted
' 0 = DEM error, 1 = component error
code As Long ' error code
szText As String * 256 ' error message text
End Type
'---------------------------------------------------------
' SESSION CONTROL BLOCK
'
' For every connection there must be a corresponding
' An SCB monitors the remote execution of queries and subsequent
' processing of queries.
'--------------------------------------------------------
Type eda_scb
eid As Long ' EDA context identifier
sid As Long ' Session identifier
command As String * 12 ' Most recent command executed
status As Long ' Status code
nbrcols As Long ' Column count
a_size As Long ' Tuple size (ALPHANUM)
b_size As Long ' Tuple size (BINARY)
count As Long ' Row count
msg_type As Long ' Message type code (0 = No message)
msg_org As String * 8 ' Message originator
msg_code As Long ' Message code
msg_text As String * 136 ' Text of message (null terminated)
msg_len As Long ' Length of message
msg_pending As Long ' Message pending indicator
msg_overflow As Long ' Message queue depth exceeded
user As String * 8 ' Reserved area for user
parm_count As String * 1 ' number of Prepare replacement fields
reserved As String * 1 ' Reserved area for future use
xopen As String * 6 ' xopen code associated with received message

End Type

'--------------------------------------------------------
' EDA INFO BLOCK
'A EDA_info_area contains a description of a column in an answer set.
'It is initialized by a call to EDAINFO and can be used by the
'application program to map the contents of a tuple returned by EDAFETCH. */
'--------------------------------------------------------
Type eda_info_area
col_name As String * 68 ' Column name
col_Length As Long ' Length of column name string
col_nbr As Long ' Index of this column (1,2, ...)
alias As String * 68 ' Alternate column name
al_length As Long ' Length of alternate column name
type As Long ' Type of the field
length As Long ' Length of the field
dcml As Long ' # decimal places
options As String * 8 ' Edit options for the field
b_size As Long ' Size of field in binary
a_offset As Long ' Alphanumeric byte position of field in tuple
b_offset As Long ' Binary byte position of field in tuple
can_be_null As Long ' 1 => yes 0 => no.
user As String * 16 ' Reserved for user
End Type

' EDA API/SQL Command Repertoire
Declare Sub EDAACCEPT Lib "edaapi.dll" (scb As eda_scb)
Declare Sub EDABROWSE Lib "edaapi.dll" (scb As eda_scb, table&, selector&, pselect&, cmd&)
Declare Sub EDACOMMIT Lib "edaapi.dll" (ecx&, yn&, result&)
Declare Sub EDACONNECT Lib "edaapi.dll" (eid&, scb As eda_scb, ByVal uname$, un_length&, ByVal password$, pw_length&, ByVal svname$, sv_length&)
Declare Sub EDADESCRIBE Lib "edaapi.dll" (scb As eda_scb, ByVal fname$, flength&)
Declare Sub EDAEXECUTE Lib "edaapi.dll" (scb As eda_scb, ByVal ename$, elength&, ByVal pname$, plength&)
Declare Sub EDAFETCH Lib "edaapi.dll" (scb As eda_scb, ByVal tuple$, tlen&, ftype&)
Declare Sub EDAFIELD Lib "edaapi.dll" (scb As eda_scb, fldno&, ByVal field$, flen&, ftype&)
Declare Sub EDAFOCUS Lib "edaapi.dll" (scb As eda_scb, ByVal stmt$, plength&)
Declare Sub EDAINFO Lib "edaapi.dll" (scb As eda_scb, column_nbr&, work_area As eda_info_area)
Declare Sub EDAINIT Lib "edaapi.dll" (eid&, result&)
Declare Sub EDAINSPECT Lib "edaapi.dll" (eid&, scb As eda_scb, action&, value&, result&)
Declare Sub EDANEXT Lib "edaapi.dll" (scb As eda_scb)
Declare Sub EDANULL Lib "edaapi.dll" (scb As eda_scb, column_nbr&, result&)
Declare Sub EDAPREPARE Lib "edaapi.dll" (scb As eda_scb, sth&, ByVal statement$, slength&)
Declare Sub EDAQUIT Lib "edaapi.dll" (scb As eda_scb)
Declare Sub EDARPC Lib "edaapi.dll" (scb As eda_scb, ByVal ename$, lnename&, ByVal parm$, plength&)
Declare Sub EDASERVERS Lib "edaapi.dll" (eid&, ByVal buf$, scount&, result&)
Declare Sub EDASET Lib "edaapi.dll" (eid&, scb As eda_scb, action&, value&, result&)
Declare Sub EDASQL Lib "edaapi.dll" (scb As eda_scb, ByVal stmt$, lnstmt&, est1&, est2&, ByVal dpass$, dlen&, execute1&)
Declare Sub EDATERM Lib "edaapi.dll" (eid&, result&)
Declare Sub EDATEST Lib "edaapi.dll" (scb As eda_scb, waiting&)
Declare Sub EDAUSING Lib "edaapi.dll" (scb As eda_scb, sth&, parm&, ByVal vlu$, vlulen&, dtype&, dlen&, dscale&, endparm&)
Declare Sub EDAWAIT Lib "edaapi.dll" (eid&, timeout&, sid&, result&)
Declare Sub EDAXCONNECT Lib "edaapi.dll" (scb As eda_scb)
Declare Sub EDAXPREPARE Lib "edaapi.dll" (scb As eda_scb, sth&)

'-------------------------------------------------------
' End of GLOBAL Section
'-------------------------------------------------------

iWay Software