home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / readme / fileins / ibmdbaix.fx1 < prev    next >
Encoding:
Text File  |  1995-10-24  |  1.3 KB  |  35 lines

  1.  
  2.  
  3. !AbtIbmDatabaseManager privateMethods !
  4.  
  5. bindCallForDatabaseNamed: aDbNameString ifError: anErrorBlock
  6.     "Send the DLL call to bind to aDbNameString.  If error, 
  7.      execute anErrorBlock."
  8.  
  9.     | args sqlopt |
  10.     ( self isTraceActive ) 
  11.         ifTrue: [ self logTraceMessage: AbtDbmTraceBindDb 
  12.                 with: aDbNameString ].
  13.     (( sqlopt := self buildSqlOpt )
  14.         at: 'options' subscript: 1)
  15.             at: 'type' put: 1;"SQL_DATETIME_OPT"
  16.             at: 'value' put: $3."SQL_DATETIME_ISO"
  17.     sqlopt at: 'used' put: 1.
  18.     args := Array new: 4.
  19.     args
  20.         at: 1 put: ((self bindFileFullNameFor: self bindFileName ) abrAsPSZ);
  21.         at: 2 put: ('bind.msg' abrAsPSZ);
  22.         at: 3 put: ( sqlopt abtAsExternalPassedPointer );
  23.         at: 4 put: (self sqlca abtAsExternalPassedPointer ).
  24.     self callPlatformFunction: IbmDbBindTo withArray: args 
  25.         useThreadPreference: false threadKey: self defaultThreadKey.
  26.     ( self sqlcode = 0 )
  27.         ifFalse: [ ^anErrorBlock value: ( self errorObjectForSqlca: self sqlca )].
  28.     args at: 1 put: ((self bindFileFullNameFor: self bindFileSuppName ) abrAsPSZ).
  29.     self callPlatformFunction: IbmDbBindTo withArray: args 
  30.         useThreadPreference: false threadKey: self defaultThreadKey.
  31.     ^( self sqlcode = -33 )
  32.         ifTrue: [ true ]
  33.         ifFalse: [ self verifySqlcaIfError: anErrorBlock ]
  34. ! !
  35.