📄 frmupdate.frm
字号:
VERSION 5.00
Begin VB.Form frmUpdate
Caption = "clsUPDATE SQL demo"
ClientHeight = 6165
ClientLeft = 2940
ClientTop = 1575
ClientWidth = 5085
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmUpdate.frx":0000
LinkTopic = "Form1"
ScaleHeight = 6165
ScaleWidth = 5085
Begin VB.TextBox txtNewValue
Height = 315
Left = 1470
TabIndex = 18
Top = 660
Width = 2295
End
Begin VB.ComboBox cmbColumn
Height = 315
ItemData = "frmUpdate.frx":030A
Left = 1470
List = "frmUpdate.frx":031A
Style = 2 'Dropdown List
TabIndex = 17
Top = 1980
Width = 2295
End
Begin VB.CommandButton cmdAddTable
Caption = "+"
Height = 315
Left = 3900
TabIndex = 15
Top = 1260
Width = 495
End
Begin VB.CommandButton cmdAddColumn
Caption = "+"
Height = 315
Left = 3900
TabIndex = 14
Top = 480
Width = 495
End
Begin VB.CommandButton cmdAddCondition
Caption = "+"
Height = 315
Left = 3900
TabIndex = 13
Top = 2940
Width = 495
End
Begin VB.CommandButton cmdClearSQL
Caption = "Clear SQL"
Height = 435
Left = 525
TabIndex = 11
Top = 5220
Width = 1515
End
Begin VB.TextBox txtValue
Height = 315
Left = 1470
TabIndex = 10
Top = 2940
Width = 2295
End
Begin VB.ComboBox cmbOperator
Height = 315
ItemData = "frmUpdate.frx":0342
Left = 1470
List = "frmUpdate.frx":0361
TabIndex = 8
Top = 2460
Width = 1095
End
Begin VB.CommandButton cmdBuildSQL
Caption = "Build SQL"
Height = 435
Left = 3045
TabIndex = 6
Top = 5220
Width = 1515
End
Begin VB.TextBox txtSQL
Height = 1155
Left = 180
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 5
Top = 3900
Width = 4635
End
Begin VB.ComboBox cmbTable
Height = 315
ItemData = "frmUpdate.frx":0390
Left = 1470
List = "frmUpdate.frx":039D
TabIndex = 3
Top = 1260
Width = 2295
End
Begin VB.ComboBox cmbField
Height = 315
ItemData = "frmUpdate.frx":03BC
Left = 1470
List = "frmUpdate.frx":03CC
TabIndex = 1
Top = 240
Width = 2295
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "Value:"
Height = 195
Left = 720
TabIndex = 19
Top = 720
Width = 450
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "Select field:"
Height = 195
Left = 360
TabIndex = 16
Top = 2040
Width = 840
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "Daniel Chirca - D.Chirca@finsiel.ro"
ForeColor = &H8000000D&
Height = 195
Left = 2385
TabIndex = 12
Top = 5820
Width = 2460
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "Value:"
Height = 195
Left = 720
TabIndex = 9
Top = 3000
Width = 450
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "Operator:"
Height = 195
Left = 495
TabIndex = 7
Top = 2520
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "SQL statement:"
Height = 195
Left = 210
TabIndex = 4
Top = 3600
Width = 1125
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "Table name:"
Height = 195
Left = 330
TabIndex = 2
Top = 1320
Width = 885
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Select column:"
Height = 195
Left = 180
TabIndex = 0
Top = 300
Width = 1035
End
End
Attribute VB_Name = "frmUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim cUpdate As clsUPDATE
Private Sub cmdAddColumn_Click()
If Me.cmbField <> "" Then
With cUpdate
.AddUpdateColumn Me.cmbField, Me.txtNewValue
End With
MsgBox "Column added."
End If
End Sub
Private Sub cmdAddCondition_Click()
If Me.cmbColumn <> "" And Me.cmbOperator <> "" Then
With cUpdate
.AddConditionColumn Me.cmbColumn, Me.cmbOperator.ListIndex + 1, Me.txtValue
End With
MsgBox "Condition added."
End If
End Sub
Private Sub cmdAddTable_Click()
If Me.cmbTable <> "" Then
With cUpdate
.AddTable Me.cmbTable
End With
MsgBox "Table added."
End If
End Sub
Private Sub cmdBuildSQL_Click()
With cUpdate
Me.txtSQL = .BuildUPDATE
End With
End Sub
Private Sub cmdClearSQL_Click()
Me.txtSQL = ""
cUpdate.ClearSQL
End Sub
Private Sub Form_Load()
Set cUpdate = New clsUPDATE
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is ComboBox Then
ctl = ctl.List(0)
End If
Next
Me.cmbOperator.ListIndex = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set cUpdate = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -