嗯....我寫了以下的程式碼...最主要是要讓輸入的金額(price)能夠和資料庫中的max和min比較,但現在執行卻會出現"準則運算式的資料型態不符合"找不出問題在那裡耶,因為資料庫和金額都是設成integer...大家能幫我看看嗎?謝謝...
Dim price As Integer
price = Int(txtproduct.Text)
If txtproduct.Text <> "" Then
s = "select * from prizetable"
s = s & " where id = '" & txtproduct.Text & "'"
s = s & " and max> '" & price & "'"
s = s & " and min< '" & price & "'"
Set rec = db.OpenRecordset(s)
 Set Data1.Recordset = rec
 Data1.Refresh
End If
文章標籤
全站熱搜
創作者介紹
創作者 vbqa 的頭像
vbqa

小吳 VBQA 程式設計討論

vbqa 發表在 痞客邦 留言(4) 人氣(7)