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

  1. VERSION 2.00
  2. Begin Form SQLQuery 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Modify SQL Query"
  5.    ClientHeight    =   6330
  6.    ClientLeft      =   810
  7.    ClientTop       =   1650
  8.    ClientWidth     =   8625
  9.    Height          =   7020
  10.    Left            =   750
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6330
  13.    ScaleWidth      =   8625
  14.    Top             =   1020
  15.    Width           =   8745
  16.    Begin TextBox Text5 
  17.       BackColor       =   &H00C0C0C0&
  18.       BorderStyle     =   0  'None
  19.       Height          =   495
  20.       Left            =   480
  21.       MultiLine       =   -1  'True
  22.       TabIndex        =   11
  23.       Text            =   "FROM and WHERE parts of the query can be changed if required. New ranges and links can be added and existing ones changed."
  24.       Top             =   4320
  25.       Width           =   7575
  26.    End
  27.    Begin TextBox Text4 
  28.       BackColor       =   &H00C0C0C0&
  29.       BorderStyle     =   0  'None
  30.       Height          =   735
  31.       Left            =   480
  32.       MultiLine       =   -1  'True
  33.       TabIndex        =   10
  34.       Text            =   "SELECT lists fields used in the report including those in formulas, totals, sorts, selections and ranges. FROM lists tables in the report followed by their aliases. WHERE specifies field ranges and links between tables."
  35.       Top             =   3600
  36.       Width           =   7575
  37.    End
  38.    Begin TextBox Text3 
  39.       BackColor       =   &H00C0C0C0&
  40.       BorderStyle     =   0  'None
  41.       Height          =   255
  42.       Left            =   480
  43.       TabIndex        =   9
  44.       Text            =   "Description:"
  45.       Top             =   3240
  46.       Width           =   1215
  47.    End
  48.    Begin TextBox Text2 
  49.       Alignment       =   1  'Right Justify
  50.       BackColor       =   &H00C0C0C0&
  51.       Height          =   1935
  52.       Left            =   360
  53.       MultiLine       =   -1  'True
  54.       TabIndex        =   8
  55.       Top             =   3000
  56.       Width           =   7815
  57.    End
  58.    Begin SSPanel Panel3D1 
  59.       Alignment       =   1  'Left Justify - MIDDLE
  60.       BevelInner      =   1  'Inset
  61.       BorderWidth     =   1
  62.       Height          =   2175
  63.       Left            =   240
  64.       TabIndex        =   0
  65.       Top             =   2880
  66.       Width           =   8055
  67.    End
  68.    Begin CommandButton Command5 
  69.       Caption         =   "Help"
  70.       Height          =   375
  71.       Left            =   7080
  72.       TabIndex        =   7
  73.       Top             =   5280
  74.       Width           =   1215
  75.    End
  76.    Begin CommandButton Command4 
  77.       Caption         =   "Cancel"
  78.       Height          =   375
  79.       Left            =   5625
  80.       TabIndex        =   6
  81.       Top             =   5280
  82.       Width           =   1215
  83.    End
  84.    Begin SSPanel Statusbar 
  85.       Alignment       =   1  'Left Justify - MIDDLE
  86.       BorderWidth     =   1
  87.       Height          =   495
  88.       Left            =   0
  89.       TabIndex        =   5
  90.       Top             =   5880
  91.       Width           =   9735
  92.    End
  93.    Begin TextBox Text1 
  94.       Height          =   2535
  95.       Left            =   240
  96.       MultiLine       =   -1  'True
  97.       ScrollBars      =   3  'Both
  98.       TabIndex        =   4
  99.       Top             =   240
  100.       Width           =   8055
  101.    End
  102.    Begin CommandButton Command3 
  103.       Caption         =   "OK"
  104.       Height          =   375
  105.       Left            =   4200
  106.       TabIndex        =   3
  107.       Top             =   5280
  108.       Width           =   1215
  109.    End
  110.    Begin CommandButton Command2 
  111.       Caption         =   "Set SQL Query"
  112.       Height          =   375
  113.       Left            =   2160
  114.       TabIndex        =   2
  115.       Top             =   5280
  116.       Width           =   1935
  117.    End
  118.    Begin CommandButton Command1 
  119.       Caption         =   "Get SQL Query"
  120.       Height          =   375
  121.       Left            =   240
  122.       TabIndex        =   1
  123.       Top             =   5280
  124.       Width           =   1815
  125.    End
  126.    Begin Menu MenuFile 
  127.       Caption         =   "&File"
  128.       Begin Menu MenuFileExit 
  129.          Caption         =   "&Exit"
  130.       End
  131.    End
  132. Sub Command1_Click ()
  133.   Dim Query As String
  134.   Dim TextHandle As Integer, TextLength As Integer
  135.   If PEGetSQLQuery(JobNum, TextHandle, TextLength) = False Then
  136.       RCode = GetErrorString(JobNum)
  137.       MsgBox "PEGetSQLQuery Error #: " + Str(ErrorCode) + " - " + RCode
  138.   End If
  139.   'Allocate memory for string
  140.   Query = String(TextLength, " ")
  141.   If PEGetHandleString(TextHandle, Query, TextLength) = False Then
  142.       RCode = GetErrorString(JobNum)
  143.       MsgBox "PEGetHandleString Error #: " + Str(ErrorCode) + " - " + RCode
  144.   Else
  145.     Text1.Text = Query
  146.     SQLQuery!Statusbar.Caption = "The SQL Query Has been retrieved!"
  147.   End If
  148. End Sub
  149. Sub Command2_Click ()
  150.  If Text1.Text = "" Then
  151.    MsgBox ("You must have and SQL Query inorder to Pass to Crystal.")
  152.  Else
  153.    If PESetSQLQuery(JobNum, Text1.Text) = False Then
  154.       RCode = GetErrorString(JobNum)
  155.       MsgBox "PESetSQLQuery Error #: " + Str(ErrorCode) + " - " + RCode
  156.    Else
  157.      SQLQuery!Statusbar.Caption = "SQL Query has been Set."
  158.    End If
  159.   End If
  160. End Sub
  161. Sub Command3_Click ()
  162.   Unload Me
  163. End Sub
  164. Sub Command4_Click ()
  165.  Unload Me
  166. End Sub
  167. Sub Command5_Click ()
  168.  RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  169.  If RCode = False Then
  170.    MsgBox ("RedPoint cannot find the Crystal Help file in C:\CRW directory")
  171.  End If
  172. End Sub
  173. Sub MenuFileExit_Click ()
  174.  Unload Me
  175. End Sub
  176.