home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "SQL - Program Comparison"
- ClientHeight = 5040
- ClientLeft = 1245
- ClientTop = 1635
- ClientWidth = 6780
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 5505
- Left = 1155
- LinkTopic = "Form1"
- ScaleHeight = 5040
- ScaleWidth = 6780
- Top = 1260
- Width = 6960
- Begin VB.TextBox Text13
- Enabled = 0 'False
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 9.75
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 855
- Left = 360
- MultiLine = -1 'True
- TabIndex = 26
- Text = "SQLCALC.frx":0000
- Top = 120
- Width = 5895
- End
- Begin VB.TextBox Text12
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 4800
- TabIndex = 25
- Text = "Text12"
- Top = 4320
- Width = 1335
- End
- Begin VB.TextBox Text11
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 1440
- TabIndex = 24
- Text = "Text11"
- Top = 4320
- Width = 1215
- End
- Begin VB.CommandButton Command2
- Caption = "Program Calculation"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 3600
- TabIndex = 21
- Top = 1200
- Width = 2535
- End
- Begin VB.CommandButton Command1
- Caption = "SQL Calculation"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 360
- TabIndex = 20
- Top = 1200
- Width = 2295
- End
- Begin VB.TextBox Text10
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 4800
- TabIndex = 19
- Text = "Text10"
- Top = 3840
- Width = 1335
- End
- Begin VB.TextBox Text9
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 4800
- TabIndex = 18
- Text = "Text9"
- Top = 3360
- Width = 1335
- End
- Begin VB.TextBox Text8
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 4800
- TabIndex = 17
- Text = "Text8"
- Top = 2880
- Width = 1335
- End
- Begin VB.TextBox Text7
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 4800
- TabIndex = 16
- Text = "Text7"
- Top = 2400
- Width = 1335
- End
- Begin VB.TextBox Text6
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 4800
- TabIndex = 15
- Text = "Text6"
- Top = 1920
- Width = 1335
- End
- Begin VB.TextBox Text5
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 1440
- TabIndex = 14
- Text = "Text5"
- Top = 3840
- Width = 1215
- End
- Begin VB.TextBox Text4
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 1440
- TabIndex = 13
- Text = "Text4"
- Top = 3360
- Width = 1215
- End
- Begin VB.TextBox Text3
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 1440
- TabIndex = 12
- Text = "Text3"
- Top = 2880
- Width = 1215
- End
- Begin VB.TextBox Text2
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 1440
- TabIndex = 11
- Text = "Text2"
- Top = 2400
- Width = 1215
- End
- Begin VB.TextBox Text1
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 1440
- TabIndex = 10
- Text = "Text1"
- Top = 1920
- Width = 1215
- End
- Begin VB.Line Line1
- BorderWidth = 2
- X1 = 3240
- X2 = 3240
- Y1 = 1200
- Y2 = 4800
- End
- Begin VB.Label Label12
- Caption = "Count:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 3720
- TabIndex = 23
- Top = 4320
- Width = 615
- End
- Begin VB.Label Label11
- Caption = "Count:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 360
- TabIndex = 22
- Top = 4320
- Width = 615
- End
- Begin VB.Label Label10
- Caption = "Average:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 3720
- TabIndex = 9
- Top = 3840
- Width = 735
- End
- Begin VB.Label Label9
- Caption = "Maximum:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 3720
- TabIndex = 8
- Top = 3360
- Width = 855
- End
- Begin VB.Label Label8
- Caption = "Minimum:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 3720
- TabIndex = 7
- Top = 2880
- Width = 735
- End
- Begin VB.Label Label7
- Caption = "Finish Time:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 3720
- TabIndex = 6
- Top = 2400
- Width = 975
- End
- Begin VB.Label Label6
- Caption = "Start Time:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 3720
- TabIndex = 5
- Top = 1920
- Width = 855
- End
- Begin VB.Label Label5
- Caption = "Average:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 360
- TabIndex = 4
- Top = 3840
- Width = 735
- End
- Begin VB.Label Label4
- Caption = "Maximum:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 360
- TabIndex = 3
- Top = 3360
- Width = 855
- End
- Begin VB.Label Label3
- Caption = "Minimum:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 360
- TabIndex = 2
- Top = 2880
- Width = 735
- End
- Begin VB.Label Label2
- Caption = "Finish Time:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 360
- TabIndex = 1
- Top = 2400
- Width = 975
- End
- Begin VB.Label Label1
- Caption = "Start Time:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 360
- TabIndex = 0
- Top = 1920
- Width = 855
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Dim OldDb As DATABASE, RcSet As Recordset, OldWs As Workspace
- Private Sub Command1_Click()
- Sqlstate = "SELECT COUNT(*) as Cntsql,MIN([Total Cost]) as Minsql,"
- Sqlstate = Sqlstate + "MAX([Total Cost]) as Maxsql, AVG([Total Cost])"
- Sqlstate = Sqlstate + "as Avgsql FROM Fishbuys"
- Text1.TEXT = Time()
- Set RcSet = OldDb.OpenRecordset(Sqlstate, dbOpenDynaset)
- Text3.TEXT = RcSet("Minsql")
- Text4.TEXT = RcSet("Maxsql")
- Text5.TEXT = RcSet("Avgsql")
- Text11.TEXT = RcSet("Cntsql")
- Text2.TEXT = Time()
- RcSet.Close
- End Sub
- Private Sub Command2_Click()
- Text6.TEXT = Time()
- Set RcSet = OldDb.OpenRecordset("Fishbuys", dbOpenTable)
- RcSet.MoveFirst
- Mmcnt = 1
- Sumprg = RcSet("Total Cost")
- Minprg = RcSet("Total Cost")
- Maxprg = RcSet("Total Cost")
- Do While Not RcSet.EOF
- RcSet.MoveNext
- If RcSet.EOF Then
- Exit Do
- End If
- Sumprg = Sumprg + RcSet("Total Cost")
- Mmcnt = Mmcnt + 1
- If RcSet("Total Cost") < Minprg Then
- Minprg = RcSet("Total Cost")
- End If
- If RcSet("Total Cost") > Maxprg Then
- Maxprg = RcSet("Total Cost")
- End If
- Loop
- Text8.TEXT = Minprg
- Text9.TEXT = Maxprg
- Text10.TEXT = Sumprg / Mmcnt
- Text12.TEXT = Mmcnt
- Text7.TEXT = Time()
- RcSet.Close
- End Sub
- Private Sub Form_Load()
- Set OldWs = DBEngine.Workspaces(0)
- Set OldDb = OldWs.OpenDatabase(App.Path & "\CHAPTER4.MDB")
- End Sub
-