?? 怎樣在vb5下實現對數據庫按字段組合查詢.txt
字號:
關 于 的 字 段 組 合 查 詢 可 用 Querydef對 象 來 實 現 。 例 : 一 數 據 庫 有 一 nps表 內 有 name,phone,address三 個 字 段 , 用 戶 選 擇 對 name,phone進 行 查 詢 , 并 在 相 應 的 textname,textphone中 輸 入 了 要 查 詢 的 值 。 代 碼 如 下 (假 定 已 打 開 數 據 庫 ):
Dim dbqu As Dao.QueryDef, dbre As Dao.Recordset
Dim strsql As String
strsql="parameters[nam1] string,[phone1] string; "
strsql=strsql+"select * from nps where name=[name1] and phone=[phone1]"
Set dbqu=db.CreateQuerydef("",strsql)
dbqu.parameters("name1") = textname.text
dbqu.parameters("phone1") = textphone.text
Set dbre=dbqu.OpenRecordset()
在 vb6的 幫 助 中 有 詳 細 說 明 。
<END>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -