home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / nivb_src / nsinfo.frm < prev    next >
Text File  |  1993-06-03  |  6KB  |  195 lines

  1. VERSION 2.00
  2. Begin Form NameSpaceInfoForm 
  3.    Caption         =   "Name Space Information"
  4.    Height          =   5385
  5.    Left            =   810
  6.    LinkTopic       =   "Form2"
  7.    ScaleHeight     =   4980
  8.    ScaleWidth      =   4680
  9.    Top             =   1185
  10.    Width           =   4800
  11.    Begin ListBox DataStreamList 
  12.       Height          =   615
  13.       Left            =   1560
  14.       TabIndex        =   11
  15.       Top             =   2640
  16.       Width           =   3015
  17.    End
  18.    Begin ListBox NameSpaceList 
  19.       Height          =   1200
  20.       Left            =   1560
  21.       TabIndex        =   9
  22.       Top             =   1320
  23.       Width           =   3015
  24.    End
  25.    Begin CommandButton OKButton 
  26.       Caption         =   "&OK"
  27.       Height          =   372
  28.       Left            =   1800
  29.       TabIndex        =   0
  30.       Top             =   4560
  31.       Width           =   1092
  32.    End
  33.    Begin Label Label8 
  34.       Caption         =   "Name spaces marked by a tilde (~) are not supported by the operating system on the selected server."
  35.       Height          =   612
  36.       Left            =   360
  37.       TabIndex        =   14
  38.       Top             =   3840
  39.       Width           =   3972
  40.    End
  41.    Begin Label Label7 
  42.       Caption         =   "Name spaces or data streams marked by an asterisk (*) are not supported by the volume."
  43.       Height          =   372
  44.       Left            =   360
  45.       TabIndex        =   13
  46.       Top             =   3360
  47.       Width           =   3852
  48.    End
  49.    Begin Label Label6 
  50.       Alignment       =   1  'Right Justify
  51.       Caption         =   "Data streams supported:"
  52.       Height          =   372
  53.       Left            =   240
  54.       TabIndex        =   12
  55.       Top             =   2520
  56.       Width           =   1212
  57.    End
  58.    Begin Label Label5 
  59.       Alignment       =   1  'Right Justify
  60.       Caption         =   "Name spaces supported:"
  61.       Height          =   372
  62.       Left            =   120
  63.       TabIndex        =   10
  64.       Top             =   1200
  65.       Width           =   1332
  66.    End
  67.    Begin Label NumDataStreamLabel 
  68.       Height          =   252
  69.       Left            =   2400
  70.       TabIndex        =   8
  71.       Top             =   840
  72.       Width           =   2052
  73.    End
  74.    Begin Label NumNameSpaceLabel 
  75.       Height          =   252
  76.       Left            =   2400
  77.       TabIndex        =   7
  78.       Top             =   600
  79.       Width           =   2052
  80.    End
  81.    Begin Label VolumeLabel 
  82.       Height          =   252
  83.       Left            =   2400
  84.       TabIndex        =   6
  85.       Top             =   360
  86.       Width           =   2052
  87.    End
  88.    Begin Label ServerLabel 
  89.       Height          =   252
  90.       Left            =   2400
  91.       TabIndex        =   5
  92.       Top             =   120
  93.       Width           =   2172
  94.    End
  95.    Begin Label Label4 
  96.       Alignment       =   1  'Right Justify
  97.       Caption         =   "Number of Data Streams:"
  98.       Height          =   252
  99.       Left            =   120
  100.       TabIndex        =   4
  101.       Top             =   840
  102.       Width           =   2172
  103.    End
  104.    Begin Label Label3 
  105.       Alignment       =   1  'Right Justify
  106.       Caption         =   "Number of Name Spaces:"
  107.       Height          =   252
  108.       Left            =   120
  109.       TabIndex        =   3
  110.       Top             =   600
  111.       Width           =   2172
  112.    End
  113.    Begin Label Label2 
  114.       Alignment       =   1  'Right Justify
  115.       Caption         =   "Volume:"
  116.       Height          =   252
  117.       Left            =   720
  118.       TabIndex        =   2
  119.       Top             =   360
  120.       Width           =   1572
  121.    End
  122.    Begin Label Label1 
  123.       Alignment       =   1  'Right Justify
  124.       Caption         =   "Server:"
  125.       Height          =   252
  126.       Left            =   840
  127.       TabIndex        =   1
  128.       Top             =   120
  129.       Width           =   1452
  130.    End
  131. End
  132.  
  133. Sub Form_Load ()
  134.     Dim buffer As NWBUFFER
  135.     Dim nameSpaceName As String * 16
  136.     Dim dataStreamName As String * 48
  137.  
  138.     ccode% = GetConnectionID(serverName$, connID%)
  139.     If (ccode% <> SUCCESSFUL) Then
  140.         MsgBox "Unable to get connection ID of server " + serverName$, MB_OK, "Error"
  141.     Else
  142.         Unload NameSpaceForm
  143.         SetPreferredConnectionID (connID%)
  144.         ccode% = GetVolumeNumber(volumeName$, volume%)
  145.         ccode% = FillNameSpaceBuffer(connID%, volume%, buffer)
  146.  
  147.         If (ccode% <> SUCCESSFUL) Then
  148.             MsgBox "Unable to get name space information", MB_OK, "Error"
  149.         Else
  150.             ccode% = GetNumNameSpaceAndDataStreams(buffer, numNameSpaces%, numDataStreams%)
  151.  
  152.             ns = 0
  153.             nsFound = 1
  154.             Do
  155.                 ccode% = GetNameSpaceInfo(buffer, ns, nameSpaceName, osReady%, volSupports%)
  156.                 nsName = Left$(nameSpaceName, InStr(nameSpaceName, Chr$(0)) - 1)
  157.                 If (ccode% = SUCCESSFUL) Then
  158.                     nsFound = nsFound + 1
  159.                     If (volSupports% = 0) Then nsName = nsName + "*"
  160.                     If (osReady% = 0) Then nsName = nsName + "~"
  161.                     NameSpaceList.AddItem nsName
  162.                 End If
  163.                 ns = ns + 1
  164.             Loop While ((ns < 10) And (nsFound < numNameSpaces%))
  165.  
  166.             ds = 0
  167.             dsFound = 1
  168.             Do
  169.                 ccode% = GetDataStreamInfo(buffer, ds, dataStreamName, volSupports%)
  170.                 dsName = Left$(dataStreamName, InStr(dataStreamName, Chr$(0)) - 1)
  171.                 If (ccode% = SUCCESSFUL) Then
  172.                     dsFound = dsFound + 1
  173.                     If (volSupports% = 0) Then dsName = dsName + "*"
  174.                     DataStreamList.AddItem dsName
  175.                 End If
  176.                 ds = ds + 1
  177.             Loop While ((ds < 10) And (dsFound < numDataStreams%))
  178.  
  179.             ServerLabel = serverName$
  180.             VolumeLabel = volumeName$
  181.             NumNameSpaceLabel = Format$(numNameSpaces%)
  182.             NumDataStreamLabel = Format$(numDataStreams%)
  183.         End If
  184.     End If
  185. End Sub
  186.  
  187. Sub Form_Unload (Cancel As Integer)
  188.     SetPreferredConnectionID (originalPrefConnID%)
  189. End Sub
  190.  
  191. Sub OKButton_Click ()
  192.     Unload NameSpaceInfoForm
  193. End Sub
  194.  
  195.