vb listbox显示数据库内容
DimDBAsNewDatabase‘数据库连接类模块DimResultCountAsIntegerDB.rsType=True'数据库打开方式DB.RunSelectS...
Dim DB As New Database‘数据库连接类模块
Dim ResultCount As Integer
DB.rsType = True '数据库打开方式
DB.RunSelectSQL ("SELECT 站号 From a GROUP BY 站号")ListSTN
现在想把 上面查询语句里的内容在listbox ListSTN中显示 应该怎么写 展开
Dim ResultCount As Integer
DB.rsType = True '数据库打开方式
DB.RunSelectSQL ("SELECT 站号 From a GROUP BY 站号")ListSTN
现在想把 上面查询语句里的内容在listbox ListSTN中显示 应该怎么写 展开
展开全部
给你一段代码,看你能否看懂,看不懂再说
Sub Combox_AddItem(P_Form_Control As Object, P_Feild As String, P_Record_Name As String, Optional p_sql As String)
Dim W_Rb As New ADODB.Recordset
Dim W_Sql As String
W_Sql = "Select distinct " & P_Feild & " as Tmp_Feild From " & P_Record_Name & " Where isnull(" & P_Feild & ",'')<>''" & p_sql & " ORDER BY " & P_Feild
P_Form_Control.Clear
'常用人员名单
With W_Rb
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.ActiveConnection = G_Con
.Open W_Sql
End With
While W_Rb.EOF <> True
P_Form_Control.AddItem W_Rb!Tmp_Feild
W_Rb.MoveNext
Wend
W_Rb.Close
Set W_Rb = Nothing
End Sub
Sub Combox_AddItem(P_Form_Control As Object, P_Feild As String, P_Record_Name As String, Optional p_sql As String)
Dim W_Rb As New ADODB.Recordset
Dim W_Sql As String
W_Sql = "Select distinct " & P_Feild & " as Tmp_Feild From " & P_Record_Name & " Where isnull(" & P_Feild & ",'')<>''" & p_sql & " ORDER BY " & P_Feild
P_Form_Control.Clear
'常用人员名单
With W_Rb
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.ActiveConnection = G_Con
.Open W_Sql
End With
While W_Rb.EOF <> True
P_Form_Control.AddItem W_Rb!Tmp_Feild
W_Rb.MoveNext
Wend
W_Rb.Close
Set W_Rb = Nothing
End Sub
ZESTRON
2024-09-04 广告
2024-09-04 广告
在Dr. O.K. Wack Chemie GmbH,我们高度重视ZESTRON的表界面分析技术。该技术通过深入研究材料表面与界面的性质,为提升产品质量与可靠性提供了有力支持。ZESTRON的表界面分析不仅涵盖了相变化、化学反应、吸附与解吸...
点击进入详情页
本回答由ZESTRON提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询