?? frmweihu.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"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Frmweihu
Caption = "數據維護"
ClientHeight = 7455
ClientLeft = 60
ClientTop = 345
ClientWidth = 10410
LinkTopic = "Form1"
ScaleHeight = 7455
ScaleWidth = 10410
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "返回"
Height = 495
Left = 8280
TabIndex = 12
Top = 6240
Width = 1215
End
Begin VB.CheckBox Check1
Caption = "進入數據維護狀態(可對數據進行添加、刪除、修改)"
Height = 495
Left = 7560
TabIndex = 11
Top = 4920
Width = 2655
End
Begin VB.Frame Frame1
Caption = "查詢控制"
Height = 3255
Left = 7440
TabIndex = 2
Top = 1200
Width = 2775
Begin VB.CommandButton Command2
Caption = "查詢"
Height = 495
Left = 720
TabIndex = 10
Top = 2400
Width = 1335
End
Begin VB.TextBox Time2
Height = 375
Left = 1440
TabIndex = 9
Top = 1680
Width = 1095
End
Begin VB.TextBox Time1
Height = 390
Left = 1440
TabIndex = 8
Top = 1200
Width = 1095
End
Begin VB.ComboBox Combo2
Enabled = 0 'False
Height = 300
ItemData = "Frmweihu.frx":0000
Left = 1080
List = "Frmweihu.frx":000D
TabIndex = 5
Top = 360
Width = 1455
End
Begin VB.ComboBox Combo1
Enabled = 0 'False
Height = 300
Left = 1080
TabIndex = 4
Top = 720
Width = 1455
End
Begin VB.Label Label3
Caption = "輸入結束時間"
Height = 255
Left = 240
TabIndex = 7
Top = 1800
Width = 1215
End
Begin VB.Label Label2
Caption = "輸入起始時間"
Height = 255
Left = 240
TabIndex = 6
Top = 1320
Width = 1095
End
Begin VB.Label Label1
Caption = "選擇查詢對象"
Height = 495
Left = 240
TabIndex = 3
Top = 480
Width = 615
End
End
Begin VB.CommandButton Command1
Caption = "加載數據庫"
Height = 495
Left = 7680
TabIndex = 1
Top = 360
Width = 2055
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 9480
Top = 7080
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 7440
Top = 7080
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Frmweihu.frx":0035
Height = 7215
Left = 120
TabIndex = 0
Top = 120
Width = 7095
_ExtentX = 12515
_ExtentY = 12726
_Version = 393216
AllowUpdate = 0 'False
AllowArrows = 0 'False
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
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
Attribute VB_Name = "Frmweihu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Check1_Click()
Dim i As Integer
Select Case Check1.Value
Case 0
DataGrid1.AllowAddNew = False
DataGrid1.AllowArrows = False
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
Case 1
i = MsgBox("進入數據維護狀態,數據將可更改", 4 + 48, "提示信息")
DataGrid1.AllowAddNew = True
DataGrid1.AllowArrows = True
DataGrid1.AllowDelete = True
DataGrid1.AllowUpdate = True
End Select
End Sub
Private Sub Combo1_Click()
Adodc1.RecordSource = "select * from " & Combo1.Text & ""
Adodc1.Refresh
End Sub
Private Sub Combo2_Click()
If Combo2.Text = "引排水量" Then
Combo1.Clear
Combo1.AddItem "常熟樞紐"
Combo1.AddItem "太浦閘樞紐"
Combo1.AddItem "望亭樞紐"
ElseIf Combo2.Text = "太湖水位" Then
Combo1.Clear
Combo1.AddItem "太湖水位_總表"
Combo1.AddItem "望亭太"
Combo1.AddItem "大浦口"
Combo1.AddItem "西山"
Combo1.AddItem "夾浦"
Combo1.AddItem "小梅口"
Combo1.AddItem "太湖平均"
ElseIf Combo2.Text = "重要站點水雨情" Then
Combo1.Clear
Combo1.AddItem "常州"
Combo1.AddItem "甘露"
Combo1.AddItem "杭長橋"
Combo1.AddItem "嘉興"
Combo1.AddItem "平望"
Combo1.AddItem "蘇州"
Combo1.AddItem "琳橋"
Combo1.AddItem "無錫南門"
End If
End Sub
Private Sub Command2_Click()
Dim ID1 As Integer, ID2 As Integer
If Combo1.Text = "" Then
MsgBox ("請先選擇一個測站!")
End If
If Time1.Text = "" Then
MsgBox "請輸入起始時間!"
End If
If Time2.Text = "" Then
MsgBox "請輸入結束時間!"
End If
If Not Combo1.Text = "" And Not Time1.Text = "" And Not Time2.Text = "" Then
Adodc1.RecordSource = "select * from " & Combo1.Text & " where 日期 >=#" & CDate(Time1.Text) & "# and " & " 日期 <=#" & CDate(Time2.Text) & "#"
Adodc1.Refresh
End If
End Sub
Private Sub Command1_Click()
On Error Resume Next
Dim sfilename As String
Dim str As String
Dim adoConn As ADODB.Connection
Dim adoRt As ADODB.Recordset
Set adoConn = New ADODB.Connection
With CommonDialog1
CommonDialog1.DialogTitle = "open map document"
CommonDialog1.Filter = "table documents(*.mdb)|*.mdb"
CommonDialog1.ShowOpen
If CommonDialog1.FileName = "" Then Exit Sub
sfilename = CommonDialog1.FileName
End With
If sfilename <> "" Then
Combo1.Enabled = True
Combo2.Enabled = True
End If
str = "Provider=Microsoft.Jet.OLEDB.4.0;;Persist Security Info=False;Data Source=" & sfilename
Adodc1.ConnectionString = str
adoConn.ConnectionString = Adodc1.ConnectionString
adoConn.Open
Set adoRt = New ADODB.Recordset
Set adoRt = adoConn.OpenSchema(adSchemaTables)
adoRt.MoveFirst
While Not adoRt.EOF
If adoRt("table_type").Value = "TABLE" Then Combo1.AddItem adoRt("table_name").Value
adoRt.MoveNext
Wend
End Sub
Private Sub Command3_Click()
Unload Me
frmMain.Show
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -