home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / crystal / extras / crpedemo / storedpr.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-12-15  |  4.8 KB  |  159 lines

  1. VERSION 2.00
  2. Begin Form Storedproc 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Stored Procedures"
  5.    ClientHeight    =   2685
  6.    ClientLeft      =   1335
  7.    ClientTop       =   1800
  8.    ClientWidth     =   6885
  9.    Height          =   3090
  10.    Left            =   1275
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   2685
  13.    ScaleWidth      =   6885
  14.    Top             =   1455
  15.    Width           =   7005
  16.    Begin CommandButton stprochelp 
  17.       Caption         =   "Help"
  18.       Height          =   375
  19.       Left            =   4410
  20.       TabIndex        =   6
  21.       Top             =   2115
  22.       Width           =   1635
  23.    End
  24.    Begin CommandButton stproccancel 
  25.       Caption         =   "Cancel"
  26.       Height          =   375
  27.       Left            =   2490
  28.       TabIndex        =   5
  29.       Top             =   2115
  30.       Width           =   1785
  31.    End
  32.    Begin CommandButton Stprocok 
  33.       Caption         =   "Ok"
  34.       Height          =   375
  35.       Left            =   810
  36.       TabIndex        =   4
  37.       Top             =   2115
  38.       Width           =   1575
  39.    End
  40.    Begin SSFrame Frame3D1 
  41.       Caption         =   "Stored Procedure Information"
  42.       Font3D          =   0  'None
  43.       ForeColor       =   &H00000000&
  44.       Height          =   1590
  45.       Left            =   180
  46.       TabIndex        =   2
  47.       Top             =   270
  48.       Width           =   6495
  49.       Begin TextBox Paramtext 
  50.          Enabled         =   0   'False
  51.          FontBold        =   0   'False
  52.          FontItalic      =   0   'False
  53.          FontName        =   "MS Sans Serif"
  54.          FontSize        =   8.25
  55.          FontStrikethru  =   0   'False
  56.          FontUnderline   =   0   'False
  57.          Height          =   330
  58.          Left            =   1470
  59.          TabIndex        =   0
  60.          Top             =   405
  61.          Width           =   2445
  62.       End
  63.       Begin CommandButton StprocSet 
  64.          Caption         =   "Set"
  65.          Height          =   375
  66.          Left            =   210
  67.          TabIndex        =   3
  68.          Top             =   900
  69.          Width           =   1125
  70.       End
  71.       Begin TextBox Stproctext 
  72.          Height          =   375
  73.          Left            =   1440
  74.          TabIndex        =   1
  75.          Top             =   900
  76.          Width           =   4755
  77.       End
  78.       Begin ComboBox Stproccombo 
  79.          Height          =   300
  80.          Left            =   1470
  81.          TabIndex        =   7
  82.          Top             =   405
  83.          Width           =   2685
  84.       End
  85.       Begin Label Label1 
  86.          BackColor       =   &H00C0C0C0&
  87.          Caption         =   "Parameters:"
  88.          Height          =   285
  89.          Left            =   150
  90.          TabIndex        =   8
  91.          Top             =   450
  92.          Width           =   1125
  93.       End
  94.    End
  95. Dim ParamN As Integer
  96. Sub Form_Load ()
  97. 'Declarations
  98. Dim NParameters As Integer
  99. Dim I As Integer
  100. Dim ParamHandle As Integer, ParamLength As Integer
  101. Dim Paramname As String
  102. 'Determine the number of Parameters
  103. NParameters = PEGetNParams(JobNum)
  104. 'If there are no parameters then do not open dialogue
  105. If NParameters = 0 Then
  106.   MsgBox ("There are no parameters in your stored procedure or you do not have a stored procedure!")
  107.   Exit Sub
  108. End If
  109. 'Get each Parameter and populate the list box
  110. For I = 0 To NParameters - 1
  111.     If PEGetNthParam(JobNum, I, ParamHandle, ParamLength) = False Then
  112.       RCode = GetErrorString(JobNum)
  113.       MsgBox "PEGetNthParam Error #: " + Str(ErrorCode) + " - " + RCode
  114.     End If
  115.     Paramname = String(ParamLength, " ")
  116.     If PEGetHandleString(ParamHandle, Paramname, ParamLength) = False Then
  117.      ' Handle error
  118.       RCode = GetErrorString(JobNum)
  119.       MsgBox "PEGetHandleString Error #: " + Str(ErrorCode) + " - " + RCode
  120.     Else
  121.       If I = 0 Then
  122.         ParamN = 0
  123.         ParamText.Text = Paramname
  124.         Stproctext.Text = Paramname
  125.       End If
  126.       Stproccombo.AddItem Paramname, I
  127.     End If
  128. Next I
  129. End Sub
  130. Sub stproccancel_Click ()
  131. Unload Me
  132. End Sub
  133. Sub Stproccombo_Change ()
  134.  ParamText.Text = Stproccombo.Text
  135. End Sub
  136. Sub Stproccombo_Click ()
  137.  ParamText.Text = Stproccombo.Text
  138.  Stproctext.Text = Stproccombo.Text
  139.  ParamN = Stproccombo.ListIndex
  140. End Sub
  141. Sub stprochelp_Click ()
  142.  RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  143.  If RCode = False Then
  144.    MsgBox ("CRWDEMO cannot find the Crystal Help file in C:\CRW directory")
  145.  End If
  146. End Sub
  147. Sub Stprocok_Click ()
  148.  Unload Me
  149. End Sub
  150. Sub StprocSet_Click ()
  151.   MsgBox Str(ParamN)
  152.   MsgBox Stproctext.Text
  153.   If PESetNthParam(JobNum, ParamN, Stproctext.Text) = False Then
  154.       RCode = GetErrorString(JobNum)
  155.       MsgBox "PESetNthParam Error #: " + Str(ErrorCode) + " - " + RCode
  156.   End If
  157.      
  158. End Sub
  159.