home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / crwdemo / security.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-05  |  3.7 KB  |  125 lines

  1. VERSION 2.00
  2. Begin Form Security 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Access Security"
  5.    ClientHeight    =   2535
  6.    ClientLeft      =   2250
  7.    ClientTop       =   1905
  8.    ClientWidth     =   5970
  9.    Height          =   3225
  10.    Left            =   2190
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   2535
  13.    ScaleWidth      =   5970
  14.    Top             =   1275
  15.    Width           =   6090
  16.    Begin CommandButton Command3 
  17.       Caption         =   "OK"
  18.       Height          =   420
  19.       Left            =   4275
  20.       TabIndex        =   7
  21.       Top             =   1395
  22.       Width           =   1095
  23.    End
  24.    Begin SSPanel StatusBar 
  25.       Alignment       =   1  'Left Justify - MIDDLE
  26.       BorderWidth     =   1
  27.       Height          =   510
  28.       Left            =   0
  29.       TabIndex        =   4
  30.       Top             =   2070
  31.       Width           =   7350
  32.    End
  33.    Begin TextBox Text2 
  34.       Height          =   330
  35.       Left            =   1800
  36.       PasswordChar    =   "*"
  37.       TabIndex        =   3
  38.       Top             =   765
  39.       Width           =   3570
  40.    End
  41.    Begin TextBox Text1 
  42.       Height          =   375
  43.       Left            =   1800
  44.       TabIndex        =   2
  45.       Top             =   270
  46.       Width           =   3570
  47.    End
  48.    Begin CommandButton Command2 
  49.       Caption         =   "Set Security Info"
  50.       Height          =   420
  51.       Left            =   2385
  52.       TabIndex        =   1
  53.       Top             =   1395
  54.       Width           =   1680
  55.    End
  56.    Begin CommandButton Command1 
  57.       Caption         =   "Get Security Info"
  58.       Height          =   420
  59.       Left            =   495
  60.       TabIndex        =   0
  61.       Top             =   1395
  62.       Width           =   1680
  63.    End
  64.    Begin Label Label2 
  65.       BackColor       =   &H00C0C0C0&
  66.       Caption         =   "Password"
  67.       Height          =   285
  68.       Left            =   540
  69.       TabIndex        =   6
  70.       Top             =   765
  71.       Width           =   915
  72.    End
  73.    Begin Label Label1 
  74.       BackColor       =   &H00C0C0C0&
  75.       Caption         =   "User ID"
  76.       Height          =   240
  77.       Left            =   540
  78.       TabIndex        =   5
  79.       Top             =   315
  80.       Width           =   870
  81.    End
  82.    Begin Menu MenuExit 
  83.       Caption         =   "&Exit"
  84.    End
  85. Sub Command1_Click ()
  86. Dim NTable As Integer
  87. Dim SessionInfo As PESessionInfo
  88. NTable = 0
  89. SessionInfo.StructSize = Len(SessionInfo)
  90. SessionInfo.UserID = Chr$(0)
  91. SessionInfo.Password = Chr$(0)
  92. SessionInfo.SessionHandle = 0
  93. If PEGetNthTableSessionInfo(JobNum, 0, SessionInfo) = 1 Then
  94.   Text1.Text = SessionInfo.UserID
  95.   Text2.Text = SessionInfo.Password
  96.   Security!StatusBar.Caption = "Security Info Retrieved!"
  97.       RCode = GetErrorString(JobNum)
  98.       MsgBox "PEGetNthTableSessionInfo Error #: " + Str(ErrorCode) + " - " + RCode
  99. End If
  100. End Sub
  101. Sub Command2_Click ()
  102.    Dim NTable As Integer
  103.    Dim SessionInfo As PESessionInfo
  104.    NTable = 0
  105.                                                  
  106.    SessionInfo.StructSize = Len(SessionInfo)
  107.    SessionInfo.UserID = Text1.Text + Chr$(0)
  108.    SessionInfo.Password = Text2.Text + Chr$(0)
  109.    SessionInfo.SessionHandle = 0
  110.    If PESetNthTableSessionInfo(JobNum, NTable, SessionInfo, True) = False Then
  111.       RCode = GetErrorString(JobNum)
  112.       MsgBox "PESetNthTableSessionInfo Error #: " + Str(ErrorCode) + " - " + RCode
  113.    Else
  114.       Security!StatusBar.Caption = "Security Info Set!"
  115.    End If
  116. End Sub
  117. Sub Command3_Click ()
  118.   Unload Me
  119. End Sub
  120. Sub MenuExit_Click ()
  121.  Unload Me
  122. End Sub
  123. Sub MenuMoreInfo_Click ()
  124. End Sub
  125.