📄 frmshowsell.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 frmShowSell
BorderStyle = 1 'Fixed Single
Caption = "查询已售商品"
ClientHeight = 6825
ClientLeft = 45
ClientTop = 330
ClientWidth = 7815
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 6825
ScaleWidth = 7815
Begin VB.CommandButton cmdCancel
Caption = "取 消"
Height = 495
Left = 6240
TabIndex = 8
Top = 120
Width = 1455
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 1920
Top = 6360
Visible = 0 'False
Width = 2295
_ExtentX = 4048
_ExtentY = 661
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=MSDASQL.1;Persist Security Info=False;Data Source=SellSystem"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=SellSystem"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from sell"
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 MSDataGridLib.DataGrid DataGrid1
Bindings = "frmShowSell.frx":0000
Height = 3855
Left = 120
TabIndex = 7
Top = 2160
Width = 7575
_ExtentX = 13361
_ExtentY = 6800
_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
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.CommandButton cmdallsell
Caption = "显示全部已售商品"
Height = 495
Left = 240
TabIndex = 6
Top = 120
Width = 1695
End
Begin VB.Frame fraquery
Caption = "按条件查询已售商品"
Height = 1215
Left = 0
TabIndex = 0
Top = 720
Width = 7815
Begin VB.TextBox txtName
Height = 375
Left = 1320
TabIndex = 1
Top = 600
Width = 1695
End
Begin VB.TextBox txtType
Height = 375
Left = 3960
TabIndex = 2
Top = 600
Width = 1935
End
Begin VB.CommandButton cmdquery
Caption = "查 询"
Height = 495
Left = 6240
TabIndex = 3
Top = 480
Width = 1455
End
Begin VB.Label lblName
Caption = "商品名:"
Height = 375
Left = 240
TabIndex = 5
Top = 600
Width = 855
End
Begin VB.Label lblType
Caption = "型号:"
Height = 375
Left = 3240
TabIndex = 4
Top = 600
Width = 615
End
End
End
Attribute VB_Name = "frmShowSell"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdallsell_Click()
allsell = True
'frmSellTable.Show
Call QuerySell
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdquery_Click()
allsell = False
'frmSellTable.Show
Call QuerySell
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = connStr
'让窗体居中
Call MakeCenter(Me)
End Sub
Private Sub QuerySell()
Dim rs_check As New ADODB.Recordset
Dim strsql As String
If allsell = False Then
strsql = "select * from sell where 商品名='" _
& frmShowSell.txtName.Text & "'and 型号= '" & frmShowSell.txtType.Text & "'"
Else
strsql = "select * from sell"
End If
rs_check.Open strsql, conn, adOpenKeyset, adLockPessimistic
Adodc1.RecordSource = strsql
Adodc1.Refresh
DataGrid1.ReBind
If rs_check.EOF = True Then
MsgBox "此型号商品没有销售!", vbOKOnly + vbInformation, "注意"
rs_check.Close
Exit Sub
End If
rs_check.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -