📄 form5.frm
字号:
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc3
Height = 375
Left = 7920
Top = 120
Visible = 0 'False
Width = 3615
_ExtentX = 6376
_ExtentY = 661
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 = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc4
Height = 375
Left = 0
Top = 480
Visible = 0 'False
Width = 3615
_ExtentX = 6376
_ExtentY = 661
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 = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "沟通时间"
Height = 375
Left = 6240
TabIndex = 25
Top = 1560
Width = 1575
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "购买次数"
Height = 375
Left = 720
TabIndex = 10
Top = 3120
Width = 1575
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "城 市"
Height = 375
Left = 6240
TabIndex = 8
Top = 2280
Width = 1575
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "省 份"
Height = 375
Left = 720
TabIndex = 6
Top = 2280
Width = 1575
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "联 系 人"
Height = 375
Left = 720
TabIndex = 4
Top = 1500
Width = 1575
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "客户名称"
Height = 375
Left = 720
TabIndex = 2
Top = 720
Width = 1575
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text6 = "" And Text1 = "" Then
Adodc4.RecordSource = "select a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb,max(b.gmcs) as gmcs from khzl a,xsqk b,gtqk c where a.khmc like'" & Text7 & "'and a.lxr like'" & Text8 & "'and c.gtsj like'" & Text10 & "'and a.sf like'" & Text9 & "'and a.cs like'" & Text11 & "'and a.khmc=b.khmc and a.khmc=c.khmc and a.id like'" & Form1.Text7 & "'group by a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb" _
& " union select a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb,b.gtcs-1 as gmcs from khzl a,gtqk b where a.khmc not in (select a.khmc from khzl a,xsqk b,gtqk c where a.khmc like'" & Text7 & "'and a.lxr like'" & Text8 & "'and c.gtsj like'" & Text10 & "'and a.sf like'" & Text9 & "'and a.cs like'" & Text11 & "'and a.khmc=b.khmc and a.khmc=c.khmc and a.id like'" & Form1.Text7 & "'group by a.khmc)and a.lxr like'" & Text8 & "'and b.gtsj like'" & Text10 & "'and a.sf like'" & Text9 & "'and a.cs like'" & Text11 & "'and a.khmc=b.khmc and a.id like'" & Form1.Text7 & "'and b.gtcs='1' group by a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb,b.gtcs"
Adodc4.Refresh
Set DataGrid1.DataSource = Adodc4
GoTo 1
End If
If Text6 = "" And Text1 <> "" Then
Adodc4.RecordSource = "select a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb,max(b.gmcs) as gmcs from khzl a,xsqk b,gtqk c where a.khmc like'" & Text7 & "'and a.lxr like'" & Text8 & "'and c.gtsj like'" & Text10 & "'and a.sf like'" & Text9 & "'and a.cs like'" & Text11 & "'and a.khmc=b.khmc and a.khmc=c.khmc and a.id like'" & Form1.Text7 & "'group by a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb"
Adodc4.Refresh
If Adodc4.Recordset.BOF = True And Adodc4.Recordset.EOF = True Then
Adodc4.RecordSource = "select a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb,b.gtcs-1 as gmcs from khzl a,gtqk b where a.khmc like'" & Text7.Text & "'and a.lxr like'" & Text8 & "'and b.gtsj like'" & Text10 & "'and a.sf like'" & Text9 & "'and a.cs like'" & Text11 & "'and a.khmc=b.khmc and a.id like'" & Form1.Text7 & "'and b.gtcs='1' group by a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb,b.gtcs"
Adodc4.Refresh
Set DataGrid1.DataSource = Adodc4
Else
Set DataGrid1.DataSource = Adodc4
GoTo 1
End If
End If
If Text6 <> "" And Text1 = "" Then
Adodc4.RecordSource = "select a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb,b.gmcs as gmcs from khzl a,xsqk b,gtqk c where a.khmc like'" & Text7 & "'and a.lxr like'" & Text8 & "'and c.gtsj like'" & Text10 & "'and a.sf like'" & Text9 & "'and a.cs like'" & Text11 & "'and a.khmc=b.khmc and a.khmc=c.khmc and a.id like'" & Form1.Text7 & "' and b.gmcs like'" & Text6.Text & "'group by a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb,b.gmcs"
Adodc4.Refresh
Set DataGrid1.DataSource = Adodc4
GoTo 1
End If
If Text6 <> "" And Text1 <> "" Then
Adodc4.RecordSource = "select a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb,b.gmcs as gmcs from khzl a,xsqk b,gtqk c where a.khmc like'" & Text7 & "'and a.lxr like'" & Text8 & "'and c.gtsj like'" & Text10 & "'and a.sf like'" & Text9 & "'and a.cs like'" & Text11 & "'and a.khmc=b.khmc and a.khmc=c.khmc and a.id like'" & Form1.Text7 & "' and b.gmcs like'" & Text6.Text & "'group by a.khmc,a.lxr,a.lxdh,a.dzxx,a.sf,a.cs,a.dz,a.yb,b.gmcs"
Adodc4.Refresh
Set DataGrid1.DataSource = Adodc4
GoTo 1
End If
1 If Adodc4.Recordset.BOF = True And Adodc4.Recordset.EOF = True Then
MsgBox "没有您要查询的用户信息,请核实!", vbExclamation, "系统提示您"
GoTo 2
End If
2 End Sub
Private Sub Command2_Click()
Unload Form5
End Sub
Private Sub Command3_Click()
Adodc2.RecordSource = "select sf from khzl where sf<>''and sf<>'*'group by sf "
Adodc2.Refresh
Set DataGrid2.DataSource = Adodc2
Set Text4.DataSource = Adodc2
DataGrid2.Visible = True
Text4.DataField = "sf"
End Sub
Private Sub Command4_Click()
Adodc1.RecordSource = "SELECT khmc from khzl where id like'" & Form1.Text7 & "'and khmc like'" & Text7.Text & "'and khmc<>''group by khmc"
Adodc1.Refresh
Set DataGrid4.DataSource = Adodc1
Set Text1.DataSource = Adodc1
Text1.DataField = "khmc"
DataGrid4.Visible = True
End Sub
Private Sub Command5_Click()
If Text4 = "" Then
Adodc3.RecordSource = "select cs from khzl where cs<>''and cs<>'*' group by cs"
Set DataGrid3.DataSource = Adodc3
Set Text5.DataSource = Adodc3
Text5.DataField = "cs"
DataGrid3.Visible = True
Else
Adodc3.RecordSource = "select cs from khzl where sf like '" & Text4.Text & "'and cs<>''group by cs"
Set DataGrid3.DataSource = Adodc3
Set Text5.DataSource = Adodc3
Text5.DataField = "cs"
DataGrid3.Visible = True
End If
End Sub
Private Sub DataGrid2_Click()
DataGrid2.Visible = False
End Sub
Private Sub DataGrid2_LostFocus()
DataGrid2.Visible = False
End Sub
Private Sub DataGrid3_Click()
DataGrid3.Visible = False
End Sub
Private Sub DataGrid3_LostFocus()
DataGrid3.Visible = False
End Sub
Private Sub DataGrid4_Click()
DataGrid4.Visible = False
End Sub
Private Sub DataGrid4_LostFocus()
DataGrid4.Visible = False
End Sub
Private Sub Form_Click()
DataGrid2.Visible = False
DataGrid3.Visible = False
DataGrid4.Visible = False
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc2.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc3.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc4.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
End Sub
Private Sub Text1_Change()
Text7 = "%" + Text1 + "%"
End Sub
Private Sub Text1_Click()
DataGrid4.Visible = False
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Adodc1.RecordSource = "SELECT khmc from khzl where id like'" & Form1.Text7 & "'and khmc like'" & Text7.Text & "'and khmc<>''group by khmc"
Adodc1.Refresh
Set DataGrid4.DataSource = Adodc1
Set Text1.DataSource = Adodc1
Text1.DataField = "khmc"
DataGrid4.Visible = True
End If
End Sub
Private Sub Text2_Change()
Text8 = Text2
End Sub
Private Sub Text3_Change()
Text10 = Text3
End Sub
Private Sub Text4_Change()
Text9 = Text4
End Sub
Private Sub Text4_Click()
DataGrid2.Visible = False
End Sub
Private Sub Text5_Change()
Text11 = Text5
End Sub
Private Sub Text5_Click()
DataGrid3.Visible = False
End Sub
Private Sub Text6_Change()
Text12 = Text6
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -