; strkeys = Mid(strkeys, 1, Len(strkeys) - 1)
'where子句查询条件
strWhere = vbNullString
If Len(Trim(strQuerySQL)) > 0 Then
strWhere = " where " & Trim(strQuerySQL)
Else
strWhere = vbNullString
End If
'字段排序字句
If lstOrderKey.ListCount > 0 Then
mstrOrderSQLs = ""
intLenKey = 0
For j = 0 To lstOrderKey.ListCount - 1
strOrderSQL = lstOrderKey.List(j)
If optOrder(0).Value = True Then
intLenKey = InStr(1, strOrderSQL, "(升序)", vbTextCompare)
strOrder = " ASC"
Else
intLenKey = InStr(1, strOrderSQL, "(降序)", vbTextCompare)
strOrder = " DESC"
End If
If intLenKey > 0 Then
strOrderSQL = Mid(strOrderSQL, 1, intLenKey - 1)
If mstrOrderSQLs <> "" Then
mstrOrderSQLs = mstrOrderSQLs & ","
End If
mstrOrderSQLs = mstrOrderSQLs & strOrderSQL & strOrder
End If
Next j
mstrOrderSQLs = " order by " & mstrOrderSQLs
Else
mstrOrderSQLs = ""
End If
'字符串连接生成SQL查询语句
strSQL = "select " & strKey & " from " & " 专家库 " & strWhere & mstrOrderSQLs
上一页 [1] [2] [3] [4] 下一页
|