我想利用VB達到從資料庫二次篩選的結果

時間 2022-03-12 01:50:26

1樓:匿名使用者

dim tempselstr as string

tempselstr = ""

if combo1.text <> "預設全值" then

tempselstr = tempselstr & "一級分類='" & combo1.text & "'"

end if

if combo2.text <> "預設全值" then

if tempselstr <> "" then

tempselstr = tempselstr & " and " & "二級分類='" & combo2.text & "'"

else

tempselstr = tempselstr & "二級分類='" & combo2.text & "'"

end if

end if

if tempselstr <> "" then

tempselstr = " where " & tempselstr

end if

然後使用 "select * from targetdb " & tempselstr 進行查詢

不知道我這樣寫你明不明白~

2樓:

可以做檢視啊,第一個檢視查詢第一個要求,然後第二個查詢從第一個檢視中篩選

vb高手進,vb連線mysql資料庫,怎麼把資料寫入資料庫

蹇永芬壬辰 必須安裝mysql的驅動才行,不管是vb還是c 都需要這個驅動。如下 public function exemysql byval sqlas string asadodb.recordset sql trim sql setconn new adodb.connection setrs...

php利用mysql資料庫已有的資料進行登入操作

獲取post表單提交的username username isset post username trim post username 同上 password isset post password trim post password 使用pdo連線mysql資料庫 conn new pdo my...

sql資料庫怎麼從資料庫把資料拿出來放到另資料庫呢

如果你的資料庫是相容的,那就用區域網的型式連上就好了,不相容的,只有把數匯出來,再錄進去了,在匯入時注意一下格式就好了 匯出個備份,u盤拷到另外臺電腦,匯入備份 1.根據資料量,選擇相應的檔案格式,對資料庫進行資料匯出,在另一個資料庫中進行資料匯入 2.直接對要匯出的資料庫進行分離操作,然後複製該資...