关于sql 语句count 语句的传递问题
我的后台数据库是access,check按纽被选中时,进行评估,评估的方法是拿导线高度来说,我现在是查看导线高度的状态,看它是不是满足要求.当 5500>导线高度>5800 结果为x1,当 5800>=导线高度>6100 结果为x2
最后把这些数相加得 y,只要点“评估结果”就会在text中显示出来。
Dim mycnn As ADODB.Connection
Dim myrs As ADODB.Recordset
----------------------------------------------
Private Sub Form_Load()
Set mycon = New ADODB.Connection '新建一个connection
mycon.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=aaa" '连接数据库
mycon.Open '打开数据库
Set myrs = New ADODB.Recordset '创建一个recordset 实例
End Sub
-----------------------------------------------------------
Private Sub Check1_Click()
Dim strSQL1 As String
Dim strSQL2 As String
'开始导线高度的评估
If Check1.Value = 1 Then
strSQL1 = "select count(*) from 结果 where 5500>=导线高度>5800"
strSQL2 = "select count(*) from 结果 where "5800>=导线高度>6100 "
End Sub
现在怎么把查询的count数符给x1 x2 呢?