嗯....我寫了以下的程式碼...最主要是要讓輸入的金額(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
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
文章標籤
全站熱搜

試試看這樣行不行 where id = " & txtproduct.Text & " 不要有單引號試試
拍謝,copy錯行 s = s & " and max> " & price & " s = s & " and min< " & price & " 不要有單引號試試
樓上的阿斯大大,我試過了耶...還是不行.....~"~
已經弄出來了,謝謝...^^