📄 form20.frm
字号:
EndProperty
EndProperty
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "请输入要查询光盘的软件名称"
BeginProperty Font
Name = "黑体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 615
Left = 120
TabIndex = 10
Top = 480
Width = 2055
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "请输入软件名称对应的编号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Left = 240
TabIndex = 9
Top = 2160
Width = 1935
End
End
Begin VB.Timer Timer1
Interval = 600
Left = 0
Top = 120
End
Begin VB.Timer Timer2
Interval = 600
Left = 720
Top = 120
End
Begin VB.TextBox Text3
BackColor = &H00FFC0FF&
BeginProperty Font
Name = "楷体_GB2312"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Left = 1800
TabIndex = 0
Top = 120
Width = 5775
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 8040
Top = 480
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= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=disk"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "disk"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 光盘信息表GP1"
Caption = "Adodc2"
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 MSAdodcLib.Adodc Adodc1
Height = 330
Left = 8040
Top = 0
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= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=disk"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "disk"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 光盘信息表GP2"
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
End
Attribute VB_Name = "Form20"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Conn As ADODB.Connection
Private RS As ADODB.Recordset
Private Sub Command1_Click()
Dim name As String
Adodc1.CommandType = adCmdText
Adodc2.CommandType = adCmdText
name = Combo2.Text
If Combo2.Text = "" Then
MsgBox "请输入光盘的名称!"
Else
Adodc2.RecordSource = "select * from 光盘信息表GP1 where 软件名称 =" & "'" & name & "';"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount = 0 Then
MsgBox "您输入的光盘不存在!"
Adodc2.RecordSource = "select * from 光盘信息表GP1 "
Adodc2.Refresh
Else
Adodc2.RecordSource = "select * from 光盘信息表GP1 where 软件名称 =" & "'" & name & "';"
Adodc2.Refresh
End If
End If
End Sub
Private Sub Command5_Click()
Adodc1.RecordSource = "select * from 光盘信息表GP2"
Adodc2.RecordSource = "select * from 光盘信息表GP1"
Adodc1.Refresh
Adodc2.Refresh
End Sub
Private Sub Command7_Click()
If Text8.Text = "" Then
MsgBox "请输入光盘的编号!"
Else
Adodc1.CommandType = adCmdText
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select * from 光盘信息表GP1 where 编号 =" & Text8.Text
Adodc1.RecordSource = "select * from 光盘信息表GP2 where 所属光盘编号 =" & Text8.Text
Adodc1.Refresh
Adodc2.Refresh
If Adodc2.Recordset.RecordCount = 0 Then
MsgBox "你输入的光盘编号不存在,请重新查找"
Adodc2.RecordSource = "select * from 光盘信息表GP1"
Adodc1.RecordSource = "select * from 光盘信息表GP2 "
Adodc2.Refresh
Adodc1.Refresh
Text8.Text = ""
End If
End If
End Sub
Private Sub Form_Load()
Set Conn = New ADODB.Connection
Set RS = New Recordset
Set comm = New ADODB.Command
Conn.CursorLocation = adUseClient
Conn.Open "dsn=disk", "", ""
Adodc1.Refresh
Adodc2.Refresh
Adodc2.Recordset.MoveFirst
Do While Adodc2.Recordset.EOF = False
Combo2.AddItem Adodc2.Recordset("软件名称")
Adodc2.Recordset.MoveNext
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -