ユーザーがアクセス可能な計算スクリプト・オブジェクトを入手します。プログラマはEsbGetNextItem()を使用して、使用可能なスクリプトのリストにアクセスする必要があります。
構文
EsbGetCalcList ( hCtx, UserName, AppName, DbName, isAllCalcs, pItems ) ByVal hCtx As Long ByVal UserName As String ByVal AppName As String ByVal DbName As String isAllCalcs As Integer pItems As Integer
パラメータ | 説明 |
---|---|
hCtx |
VB APIコンテキスト・ハンドル。 |
UserName |
ユーザー名。 |
AppName |
アプリケーション名。 |
DbName |
データベース名。空の文字列の場合は、アプリケーションのサブディレクトリが使用されます |
isAllCalcs |
AllowAllCalcsフラグを含む整数。AllowAllCalcsがESB_FALSEに設定されている場合は、ユーザーはすべての計算スクリプト・オブジェクトにアクセスできます。それ以外の場合は、CalcList引数で指定されたスクリプト・オブジェクトにのみアクセスできます。 |
pItems |
その内容が使用可能な計算スクリプト・オブジェクトの数を含む整数。 |
備考
計算スクリプト・オブジェクトにアクセスするには、指定されたユーザーが、少なくとも適切なデータベースに対する計算アクセス権を持っている必要があります。
pAllCalcsに戻された値がTRUEの場合、pItemsに戻される値はゼロです。
戻り値
正常終了の場合はsts=0とユーザーのAllowAllCalcs設定をpAllCalcsに戻します。AllCalcsがESB_FALSEと等しい場合、pItemsには使用可能な計算スクリプト・オブジェクト数が含まれます。EsbGetNextItem()を使用して計算スクリプト・オブジェクト名のリストにアクセスします。
isAllCalcsがESB_TRUEに等しい場合、pItemsから0が戻されるので、プログラマは戻された各オブジェクトにEsbListObjects()(ESB_OBJTYPE_CALCSCRIPTタイプ使用)とEsbGetObjectInfo()の組合せを呼び出す必要があります。
アクセス
この関数を使用するには、独自の計算リストを取得する場合を除いて、呼出し元は指定したデータベースに対してデータベース・デザイン権限(ESB_PRIV_DBDESIGN)を持っている必要があります。
例
Declare Function EsbGetCalcList Lib "ESBAPIN" (ByVal hCtx As Long, ByVal User As String, ByVal AppName As String, ByVal DbName As String, AllCalcs As Integer, Items As Integer) As Long Sub ESB_GetCalcList() Dim Items As Integer Dim AppName As String Dim DbName As String Dim User As String Dim AllCalcs As Integer Dim ObjName As String * ESB_OBJNAMELEN Dim sts As Long Dim ObjType As Long Dim ObjectInfo As ESB_OBJINFO_T ObjType = ESB_OBJTYPE_CALCSCRIPT AppName = "Sample" DbName = "Basic" User = "test_user" ' Has 'calculate' access to Sample->Basic ' If user passed in has access to everything, ' then Items will ALWAYS be set to '0'! ' In that case, use EsbListObjects() ' (of type ESB_OBJTYPE_CALCSCRIPT, and ' then EsbGetObjectInfo()! sts = EsbGetCalcList(hCtx, User, AppName, DbName, AllCalcs, Items) If AllCalcs = ESB_NO Then frmMain.lstInfo.AddItem "Number of calc script items returned: " & Items frmMain.lstInfo.AddItem "--------------------------------------------------" For n = 1 To Items sts = EsbGetNextItem(hCtx, ESB_OBJNAME_TYPE, ByVal ObjName) If sts <> 0 Then MsgBox "Failure in EsbGetNextItem(): " & sts: Exit Sub sts = EsbGetObjectInfo(hCtx, ObjType, AppName, DbName, ObjName, ObjectInfo) If sts <> 0 Then MsgBox "Failure in EsbGetObjectInfo(): " & sts: Exit Sub frmMain.lstInfo.AddItem ObjectInfo.Name frmMain.lstInfo.AddItem ObjectInfo.Type frmMain.lstInfo.AddItem "----------" Next Else frmMain.lstInfo.AddItem "You need to call EsbListObjects of type ESB_OBJTYPE_CALCSTRIPT" End If End Sub
関連トピック