在VB中,我有两个combobox,各自有以下内容,如何通过选择这两个不同内容组合来从SQL中读取相应的信息。

2024-11-24 08:15:08
推荐回答(2个)
回答1:

应该是这个样子:select form line_info where combobox1.text & combobox2.text &textbox1.text ,就是SQL

回答2:

Dim col As String
Dim sql As String
Select Case Combo1.ListIndex
Case 0
col = "carid"
Case 1
col = "name"

Case 3
col = "Ondate"

End Select
sql = "select * from table where " & col & " " & Combo2.Text & " " & text1.Text