📄 selectnanopioion_frm.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form selectjiaoopioion_frm
Caption = "查看市民对南昌市目前的交通状况发表的意见"
ClientHeight = 6090
ClientLeft = 5445
ClientTop = 2835
ClientWidth = 5685
LinkTopic = "Form1"
MaxButton = 0 'False
Picture = "selectnanopioion_frm.frx":0000
ScaleHeight = 6090
ScaleWidth = 5685
Begin VB.Frame Frame2
BackColor = &H00FFC0C0&
Height = 2175
Left = 3600
TabIndex = 4
Top = 3600
Width = 1935
Begin VB.CommandButton Command1
Caption = "删 除"
Height = 495
Left = 240
TabIndex = 6
Top = 1320
Width = 1335
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 120
TabIndex = 5
Top = 720
Width = 1575
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "选择你要删除的记录"
Height = 255
Left = 120
TabIndex = 7
Top = 360
Width = 1695
End
End
Begin MSAdodcLib.Adodc Ado
Height = 330
Left = 3600
Top = 2880
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_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 VB.CommandButton cmdexit
Caption = "退出查询"
Height = 495
Left = 1320
TabIndex = 3
Top = 4800
Width = 1455
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Height = 2175
Left = 1080
TabIndex = 1
Top = 3600
Width = 2295
Begin VB.CommandButton cmdinquire
Caption = "查询"
Height = 495
Left = 240
TabIndex = 2
Top = 360
Width = 1455
End
End
Begin MSFlexGridLib.MSFlexGrid myFlexgrid
Height = 2535
Left = 1080
TabIndex = 0
Top = 840
Width = 4455
_ExtentX = 7858
_ExtentY = 4471
_Version = 393216
Rows = 8
Cols = 4
BackColor = 16777215
BackColorBkg = 4194368
AllowUserResizing= 3
End
End
Attribute VB_Name = "selectjiaoopioion_frm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub cmdinquire_Click()
'先关闭记录集
Ado.Recordset.Close
Ado.Recordset.Open "select * from jiaotong"
'利用控件 MSFlexGrid来显示查询结果
With myFlexgrid
.Rows = 3
.CellAlignment = 1
.TextMatrix(1, 0) = "用户编号"
.TextMatrix(1, 1) = "第一道结果"
.TextMatrix(1, 2) = "第二道结果"
.TextMatrix(1, 3) = "第三道结果"
'把记录集中的数据用myFlexgrid来显示,并且行自动增长
Do While Not Ado.Recordset.EOF
.Rows = .Rows + 1
.CellAlignment = 2
.TextMatrix(.Rows - 1, 0) = Ado.Recordset.Fields(0)
.TextMatrix(.Rows - 1, 1) = Ado.Recordset.Fields(1)
.TextMatrix(.Rows - 1, 2) = Ado.Recordset.Fields(2)
.TextMatrix(.Rows - 1, 3) = Ado.Recordset.Fields(3)
'记录集下移
Ado.Recordset.MoveNext
Loop
End With
End Sub
Private Sub Command1_Click()
If Combo1.Text = "" Then
MsgBox "请你选择要删除的用户编号!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
Ado.Recordset.Close
Ado.Recordset.Open "select * from jiaotong where ID= " & CInt(Combo1.Text) & " "
On Error Resume Next
Ado.Recordset.Delete
End Sub
Private Sub Form_Load()
Dim a As Integer
'利用ADO控件来连接数据库中的jiaotong表
Ado.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db1.mdb"
Ado.CommandType = adCmdText
Ado.RecordSource = "select * from jiaotong"
Ado.Refresh
For a = 0 To Ado.Recordset.RecordCount - 1
Combo1.AddItem Ado.Recordset.Fields(0)
Ado.Recordset.MoveNext
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -