📄 fortraindata.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "msadodc.ocx"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "msdatgrd.ocx"
Begin VB.Form ForTrainData
Caption = "Form1"
ClientHeight = 6435
ClientLeft = 60
ClientTop = 435
ClientWidth = 9120
LinkTopic = "Form1"
ScaleHeight = 6435
ScaleWidth = 9120
StartUpPosition = 2 'CenterScreen
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 495
Left = 120
Picture = "ForTrainData.frx":0000
ScaleHeight = 495
ScaleWidth = 495
TabIndex = 15
Top = 120
Width = 495
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 7320
Top = 120
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=train"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=train"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 列车数据表"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame3
BackColor = &H00C0E0FF&
Caption = "操作"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 600
TabIndex = 9
Top = 5160
Width = 8175
Begin VB.CommandButton Command6
BackColor = &H0080FFFF&
Caption = "修改"
Height = 375
Left = 2760
Style = 1 'Graphical
TabIndex = 16
Top = 360
Width = 1095
End
Begin VB.CommandButton Command5
BackColor = &H0080FFFF&
Caption = "退出"
Height = 375
Left = 6720
Style = 1 'Graphical
TabIndex = 14
Top = 360
Width = 1215
End
Begin VB.CommandButton Command4
BackColor = &H0080FFFF&
Caption = "刷新"
Height = 375
Left = 5400
Style = 1 'Graphical
TabIndex = 13
Top = 360
Width = 1215
End
Begin VB.CommandButton Command3
BackColor = &H0080FFFF&
Caption = "删除"
Height = 375
Left = 4080
Style = 1 'Graphical
TabIndex = 12
Top = 360
Width = 1215
End
Begin VB.CommandButton Command2
BackColor = &H0080FFFF&
Caption = "添加"
Height = 375
Left = 1440
Style = 1 'Graphical
TabIndex = 11
Top = 360
Width = 1095
End
Begin VB.CommandButton Command1
BackColor = &H0080FFFF&
Caption = "查询"
Height = 375
Left = 120
Style = 1 'Graphical
TabIndex = 10
Top = 360
Width = 1095
End
End
Begin VB.Frame Frame2
BackColor = &H00C0E0FF&
Caption = "查询条件"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1335
Left = 600
TabIndex = 2
Top = 3600
Width = 8175
Begin VB.TextBox Text3
BackColor = &H00C0FFFF&
Height = 375
Left = 6360
TabIndex = 8
Text = "Text3"
Top = 480
Width = 1335
End
Begin VB.TextBox Text2
BackColor = &H00C0FFFF&
Height = 375
Left = 3600
TabIndex = 7
Text = "Text2"
Top = 480
Width = 1335
End
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
Height = 375
Left = 960
TabIndex = 6
Text = "Text1"
Top = 480
Width = 1215
End
Begin VB.OptionButton Option3
BackColor = &H00C0E0FF&
Caption = "终点站"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5160
TabIndex = 5
Top = 360
Width = 1335
End
Begin VB.OptionButton Option2
BackColor = &H00C0E0FF&
Caption = "起始站"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2400
TabIndex = 4
Top = 360
Width = 1335
End
Begin VB.OptionButton Option1
BackColor = &H00C0E0FF&
Caption = "车次"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 3
Top = 360
Width = 975
End
End
Begin VB.Frame Frame1
BackColor = &H00C0E0FF&
Caption = "列车数据表"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2895
Left = 600
TabIndex = 0
Top = 600
Width = 8175
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "ForTrainData.frx":08CA
Height = 2415
Left = 240
TabIndex = 1
Top = 360
Width = 7695
_ExtentX = 13573
_ExtentY = 4260
_Version = 393216
AllowUpdate = 0 'False
BackColor = 12648447
ColumnHeaders = -1 'True
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin VB.Image Image1
Appearance = 0 'Flat
Height = 11520
Left = -5280
Picture = "ForTrainData.frx":08DF
Top = -1200
Width = 15360
End
End
Attribute VB_Name = "ForTrainData"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public index As Integer
Public AddOrModify As Boolean
Private Sub Command1_Click()
If ForTrainData.index = 1 And Text1.Text = "" Then
MsgBox ("请输入车次!!!")
ElseIf ForTrainData.index = 1 And Text1.Text <> "" Then
Adodc1.RecordSource = "Select * from 列车数据表 where 车次 = '" & Text1.Text _
& "'"
Adodc1.Refresh
ElseIf ForTrainData.index = 2 And Text2.Text = "" Then
MsgBox ("请输入起点站!!!")
ElseIf ForTrainData.index = 2 And Text2.Text <> "" Then
Adodc1.RecordSource = "Select * from 列车数据表 where 起始站 = '" & Text2.Text _
& "'"
Adodc1.Refresh
ElseIf ForTrainData.index = 3 And Text3.Text = "" Then
MsgBox ("请输入终点站!!!")
ElseIf ForTrainData.index = 3 And Text3.Text <> "" Then
Adodc1.RecordSource = "Select * from 列车数据表 where 目的站 = '" & Text3.Text _
& "'"
Adodc1.Refresh
End If
End Sub
Private Sub Command2_Click()
AddOrModify = True
ForAddTrainData.Show
End Sub
Private Sub Command3_Click()
Dim i As Integer
i = MsgBox("确定删除该记录??", vbYesNo + vbExclamation, "提示")
If i = vbYes Then
If DataGrid1.SelBookmarks.Count <> 0 Then
Adodc1.Recordset.Delete
Adodc1.Recordset.Update
End If
End If
End Sub
Private Sub Command4_Click()
Adodc1.RecordSource = "select * from 列车数据表 "
Adodc1.Refresh
End Sub
Private Sub Command5_Click()
Unload Me
End Sub
Private Sub Command6_Click()
AddOrModify = False
If Adodc1.Recordset.EOF = True Or Adodc1.Recordset.BOF = True Then
MsgBox "请选择表中要修改的信息!!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
ForAddTrainData.Text1 = Adodc1.Recordset.Fields(0)
ForAddTrainData.Text2 = Adodc1.Recordset.Fields(1)
ForAddTrainData.Text3 = Adodc1.Recordset.Fields(2)
ForAddTrainData.Text4 = Adodc1.Recordset.Fields(3)
ForAddTrainData.Text5 = Adodc1.Recordset.Fields(4)
ForAddTrainData.Text6 = Adodc1.Recordset.Fields(7)
ForAddTrainData.Text7 = Adodc1.Recordset.Fields(9)
ForAddTrainData.Text8 = Adodc1.Recordset.Fields(8)
ForAddTrainData.Text9 = Adodc1.Recordset.Fields(10)
ForAddTrainData.Text10 = Adodc1.Recordset.Fields(5)
ForAddTrainData.Text11 = Adodc1.Recordset.Fields(6)
ForAddTrainData.Text12 = Adodc1.Recordset.Fields(11)
ForAddTrainData.Show
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Option1_Click()
ForTrainData.index = 1
Text2.Enabled = False
Text1.Enabled = True
Text1.SetFocus
Text3.Enabled = False
End Sub
Private Sub Option2_Click()
ForTrainData.index = 2
Text2.Enabled = True
Text2.SetFocus
Text1.Enabled = False
Text3.Enabled = False
End Sub
Private Sub Option3_Click()
ForTrainData.index = 3
Text2.Enabled = False
Text1.Enabled = False
Text3.Enabled = True
Text3.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -