【VB开源代码栏目提醒】:网学会员在VB开源代码频道为大家收集整理了C联系人统计.frm提供大家参考,希望对大家有所帮助!
VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmcontactPersonStatistics
Caption = "联系人统计"
ClientHeight = 3420
ClientLeft = 60
ClientTop = 450
ClientWidth = 6225
LinkTopic = "Form1"
ScaleHeight = 3420
ScaleWidth = 6225
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton CmdExit
BackColor = &H00C0C0C0&
Caption = "退出"
Height = 360
Left = 4440
Style = 1 'Graphical
TabIndex = 0
Top = 2940
Width = 975
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 2715
Left = 120
TabIndex = 1
Top = 120
Width = 5715
_ExtentX = 10081
_ExtentY = 4789
_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
Caption = "联系人统计列表"
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
End
Attribute VB_Name = "frmcontactPersonStatistics"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs As ADODB.Recordset
Dim SQL As String
Dim msg As String
Private Sub Form_Load()
'按不同群组ID统计
SQL = "SELECT a.GroupID, b.GroupName, b.establishDate, COUNT(a.contactID) AS "
SQL = SQL & "Number FROM 联系人信息表 a INNER JOIN " '联系人数
SQL = SQL & "群组信息表 b ON a.GroupID = b.GroupID GROUP BY a.GroupID, b.GroupName, b.establishDate"
Set rs = SelectSQL(SQL, msg)
If rs.RecordCount <> 0 Then
Set Me.DataGrid1.DataSource = rs
Else
Set Me.DataGrid1.DataSource = Nothing
End If
End Sub
Private Sub CmdExit_Click()
'退出操作
frmEDMS.Enabled = True
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
'退出操作
frmEDMS.Enabled = True
rs.Close
Unload Me
End Sub