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

  1. VERSION 2.00
  2. Begin Form SQLQuery 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Modify SQL Query"
  5.    ClientHeight    =   5820
  6.    ClientLeft      =   810
  7.    ClientTop       =   1365
  8.    ClientWidth     =   8625
  9.    Height          =   6225
  10.    Left            =   750
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5820
  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        =   10
  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        =   9
  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        =   8
  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        =   7
  55.       Top             =   3000
  56.       Width           =   7815
  57.    End
  58.    Begin SSPanel Panel3D1 
  59.       Alignment       =   1  'Left Justify - MIDDLE
  60.       BackColor       =   &H00C0C0C0&
  61.       BevelInner      =   1  'Inset
  62.       BorderWidth     =   1
  63.       Font3D          =   0  'None
  64.       Height          =   2175
  65.       Left            =   240
  66.       TabIndex        =   5
  67.       Top             =   2880
  68.       Width           =   8055
  69.    End
  70.    Begin CommandButton Command5 
  71.       Caption         =   "Help"
  72.       Height          =   375
  73.       Left            =   6930
  74.       TabIndex        =   6
  75.       Top             =   5265
  76.       Width           =   1215
  77.    End
  78.    Begin CommandButton Command4 
  79.       Caption         =   "Cancel"
  80.       Height          =   360
  81.       Left            =   5550
  82.       TabIndex        =   4
  83.       Top             =   5280
  84.       Width           =   1215
  85.    End
  86.    Begin TextBox Text1 
  87.       Height          =   2535
  88.       Left            =   240
  89.       MultiLine       =   -1  'True
  90.       ScrollBars      =   3  'Both
  91.       TabIndex        =   0
  92.       Top             =   240
  93.       Width           =   8055
  94.    End
  95.    Begin CommandButton Command3 
  96.       Caption         =   "OK"
  97.       Height          =   330
  98.       Left            =   4200
  99.       TabIndex        =   3
  100.       Top             =   5280
  101.       Width           =   1215
  102.    End
  103.    Begin CommandButton Command2 
  104.       Caption         =   "Set SQL Query"
  105.       Height          =   330
  106.       Left            =   2160
  107.       TabIndex        =   2
  108.       Top             =   5265
  109.       Width           =   1935
  110.    End
  111.    Begin CommandButton Command1 
  112.       Caption         =   "Get SQL Query"
  113.       Height          =   330
  114.       Left            =   240
  115.       TabIndex        =   1
  116.       Top             =   5265
  117.       Width           =   1815
  118.    End
  119. Sub Command1_Click ()
  120.   Dim Query As String
  121.   Dim TextHandle As Integer, TextLength As Integer
  122.   If PEGetSQLQuery(JobNum, TextHandle, TextLength) = False Then
  123.       RCode = GetErrorString(JobNum)
  124.       MsgBox "PEGetSQLQuery Error #: " + Str(ErrorCode) + " - " + RCode
  125.   End If
  126.   'Allocate memory for string
  127.   Query = String(TextLength, " ")
  128.   If PEGetHandleString(TextHandle, Query, TextLength) = False Then
  129.       RCode = GetErrorString(JobNum)
  130.       MsgBox "PEGetHandleString Error #: " + Str(ErrorCode) + " - " + RCode
  131.   Else
  132.     Text1.Text = Query
  133.     Main!StatusBar.Caption = "The SQL Query Has been retrieved!"
  134.   End If
  135. End Sub
  136. Sub Command2_Click ()
  137.  If Text1.Text = "" Then
  138.    MsgBox ("You must have and SQL Query inorder to Pass to Crystal.")
  139.  Else
  140.    If PESetSQLQuery(JobNum, Text1.Text) = False Then
  141.       RCode = GetErrorString(JobNum)
  142.       MsgBox "PESetSQLQuery Error #: " + Str(ErrorCode) + " - " + RCode
  143.    Else
  144.      Main!StatusBar.Caption = "SQL Query has been Set."
  145.    End If
  146.   End If
  147. End Sub
  148. Sub Command3_Click ()
  149.   Unload Me
  150. End Sub
  151. Sub Command4_Click ()
  152.  Unload Me
  153. End Sub
  154. Sub Command5_Click ()
  155.  RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  156.  If RCode = False Then
  157.    MsgBox ("RedPoint cannot find the Crystal Help file in C:\CRW directory")
  158.  End If
  159. End Sub
  160. Sub MenuFileExit_Click ()
  161.  Unload Me
  162. End Sub
  163.