📄 site_data.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 site_data
BorderStyle = 4 'Fixed ToolWindow
Caption = "测站参数设置"
ClientHeight = 5055
ClientLeft = 45
ClientTop = 315
ClientWidth = 6390
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5055
ScaleWidth = 6390
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.Frame Frame3
Caption = "站点列表"
Height = 1725
Left = 60
TabIndex = 19
Top = 3150
Width = 6315
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "site_data.frx":0000
Height = 1485
Left = 60
TabIndex = 22
Top = 210
Width = 6225
_ExtentX = 10980
_ExtentY = 2619
_Version = 393216
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
ColumnWidth = 884.976
EndProperty
BeginProperty Column01
ColumnWidth = 959.811
EndProperty
EndProperty
End
End
Begin VB.Frame Frame2
Height = 675
Left = 60
TabIndex = 17
Top = 2460
Width = 6315
Begin VB.CommandButton Command3
Caption = "退出"
Height = 375
Left = 4320
TabIndex = 21
Top = 180
Width = 975
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 375
Left = 2550
TabIndex = 20
Top = 180
Width = 975
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = -30
Top = -60
Visible = 0 'False
Width = 2085
_ExtentX = 3678
_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 = "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.CommandButton Command1
Caption = "添加"
Height = 375
Left = 780
TabIndex = 18
Top = 180
Width = 975
End
End
Begin VB.Frame Frame1
Caption = "单位:m"
Height = 2385
Left = 60
TabIndex = 0
Top = 60
Width = 6315
Begin VB.TextBox Text8
Height = 405
Left = 4290
TabIndex = 15
Text = "Text8"
Top = 1770
Width = 1575
End
Begin VB.TextBox Text7
Height = 405
Left = 4290
TabIndex = 13
Text = "Text7"
Top = 1240
Width = 1575
End
Begin VB.TextBox Text6
Height = 405
Left = 4290
TabIndex = 11
Text = "Text6"
Top = 710
Width = 1575
End
Begin VB.TextBox Text5
Height = 405
Left = 4290
TabIndex = 10
Text = "Text5"
Top = 180
Width = 1575
End
Begin VB.TextBox Text4
Height = 405
Left = 960
TabIndex = 7
Text = "Text4"
Top = 1830
Width = 1575
End
Begin VB.TextBox Text3
Height = 405
Left = 960
TabIndex = 5
Text = "Text3"
Top = 1280
Width = 1575
End
Begin VB.TextBox Text2
BeginProperty DataFormat
Type = 0
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
Height = 405
Left = 960
TabIndex = 3
Text = "Text2"
Top = 730
Width = 1575
End
Begin VB.TextBox Text1
Height = 405
Left = 960
TabIndex = 1
Text = "Text1"
Top = 180
Width = 1575
End
Begin VB.Label Label8
Caption = "后视点名:"
Height = 315
Left = 3330
TabIndex = 16
Top = 1860
Width = 975
End
Begin VB.Label Label7
Caption = "后视镜高:"
Height = 345
Left = 3330
TabIndex = 14
Top = 1320
Width = 1035
End
Begin VB.Label Label6
Caption = "坐标方位角:"
Height = 405
Left = 3180
TabIndex = 12
Top = 780
Width = 1245
End
Begin VB.Label Label5
Caption = "仪器高:"
Height = 375
Left = 3540
TabIndex = 9
Top = 240
Width = 915
End
Begin VB.Label Label4
Caption = "Z坐标:"
Height = 375
Left = 210
TabIndex = 8
Top = 1890
Width = 765
End
Begin VB.Label Label3
Caption = "Y坐标:"
Height = 375
Left = 210
TabIndex = 6
Top = 1350
Width = 765
End
Begin VB.Label Label2
Caption = "X坐标:"
Height = 405
Left = 240
TabIndex = 4
Top = 780
Width = 735
End
Begin VB.Label Label1
Caption = "站名:"
Height = 375
Left = 300
TabIndex = 2
Top = 270
Width = 825
End
End
End
Attribute VB_Name = "site_data"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'添加一个新测站
Dim mrc As ADODB.Recordset
Dim msgtxt As String
If Trim(Text1.Text) = "" Then
MsgBox "请输入站名!"
Text1.SetFocus
Exit Sub
End If
sitename = Trim(Text1.Text)
sqltxt = "select * from site_data where 站名='" & sitename & "'"
msgtxt = ""
Set mrc = ExecuteSQL(sqltxt, msgtxt)
If mrc.RecordCount > 0 Then
mrc.Close
MsgBox "测站已存在,请重新输入!"
Text1.SetFocus
Exit Sub
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset("站名").Value = sitename
Adodc1.Recordset("X坐标").Value = Trim(Text2.Text)
Adodc1.Recordset("Y坐标").Value = Trim(Text3.Text)
Adodc1.Recordset("Z坐标").Value = Trim(Text4.Text)
Adodc1.Recordset("仪器高").Value = Trim(Text5.Text)
Adodc1.Recordset("后视点名").Value = Trim(Text8.Text)
Adodc1.Recordset("后视镜高").Value = Trim(Text7.Text)
Adodc1.Recordset("坐标方位角").Value = Trim(Text6.Text)
Adodc1.Recordset("创建时间").Value = Now()
Adodc1.Recordset.Update
Adodc1.Refresh
Adodc1.Refresh
End If
End Sub
Private Sub Command2_Click()
If Adodc1.Recordset.EOF Or Adodc1.Recordset.BOF Then
MsgBox "未选择站点"
Exit Sub
Else
Adodc1.Recordset.Delete
Adodc1.Refresh
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\pyppeo.mdb;Persist Security Info=False"
Adodc1.ConnectionString = connstr
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from site_data order by 创建时间 desc"
Adodc1.Refresh
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\pyppeo.mdb;Persist Security Info=False"
Adodc1.ConnectionString = connstr
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from site_data order by 创建时间 desc"
Adodc1.Refresh
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -