?? rsbili.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form rsbili
BorderStyle = 4 'Fixed ToolWindow
Caption = "人數比例"
ClientHeight = 2925
ClientLeft = 45
ClientTop = 285
ClientWidth = 2445
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2925
ScaleWidth = 2445
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin MSAdodcLib.Adodc Adodc2
Height = 735
Left = -360
Top = 2760
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 1296
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 = "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 VB.Frame Frame3
Height = 2895
Left = 0
TabIndex = 0
Top = 0
Width = 2415
Begin VB.CommandButton Command1
Caption = "確定"
Height = 375
Left = 1440
TabIndex = 8
Top = 2400
Width = 855
End
Begin VB.Frame Frame2
Height = 1095
Left = 120
TabIndex = 6
Top = 1200
Width = 2175
Begin VB.Label Label6
AutoSize = -1 'True
Height = 180
Left = 600
TabIndex = 13
Top = 720
Width = 90
End
Begin VB.Label Label10
AutoSize = -1 'True
Height = 180
Left = 1200
TabIndex = 12
Top = 720
Width = 90
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "/"
Height = 180
Left = 960
TabIndex = 11
Top = 720
Width = 90
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "男女比例約為"
Height = 180
Left = 480
TabIndex = 7
Top = 360
Width = 1080
End
End
Begin VB.Frame Frame1
Height = 1095
Left = 120
TabIndex = 1
Top = 120
Width = 2175
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "人"
Height = 180
Left = 1440
TabIndex = 10
Top = 720
Width = 180
End
Begin VB.Label Label7
Caption = "人"
Height = 255
Left = 1440
TabIndex = 9
Top = 360
Width = 375
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "男生"
Height = 180
Left = 240
TabIndex = 5
Top = 360
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
Height = 180
Left = 960
TabIndex = 4
Top = 360
Width = 90
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "女生"
Height = 180
Left = 240
TabIndex = 3
Top = 720
Width = 360
End
Begin VB.Label Label4
AutoSize = -1 'True
Height = 180
Left = 960
TabIndex = 2
Top = 720
Width = 90
End
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 1800
Top = 1800
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 873
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
End
Attribute VB_Name = "rsbili"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim provider As String
Dim datasource As String
provider = "provider=Microsoft.jet.oledb.4.0"
datasource = "data source=" & App.Path & "\DB.mdb"
With Adodc1
.Mode = adModeReadWrite
.ConnectionString = provider & ";" & datasource
.CommandType = adCmdTable
.RecordSource = "users"
.Refresh
End With
Dim I, J As Integer
Dim sql1, sql2 As String
sql1 = "select count(性別) from users where 性別='男'"
sql2 = "select count(性別) from users where 性別='女'"
With Adodc2
.Mode = adModeReadWrite
.ConnectionString = provider & ";" & datasource
.CommandType = adCmdText
.RecordSource = sql1
.Refresh
End With
Label2.Caption = Adodc2.Recordset.GetString
Adodc2.Recordset.ActiveConnection = Nothing
With Adodc2
.Mode = adModeReadWrite
.ConnectionString = provider & ";" & datasource
.CommandType = adCmdText
.RecordSource = sql2
.Refresh
End With
Label4.Caption = Adodc2.Recordset.GetString
Dim s, x As String
Dim Y As String
If Label4.Caption = 0 Then
Label6.Caption = Label2.Caption
Label10.Caption = 0
Exit Sub
End If
If Label2.Caption = 0 Then
Label6.Caption = 0
Label10.Caption = Label4.Caption
Exit Sub
End If
s = Label2.Caption / Label4.Caption
x = Left(s, 3)
If x < 1 Then
Y = 1 / x
Label6.Caption = Y
Label10.Caption = 1
ElseIf x > 1 Then
Label6.Caption = x
Label10.Caption = 1
Else
Label6.Caption = 1
Label10.Caption = 1
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -