

運行后結果說like附近有誤,,,可是真的覺得沒有啊
求幫看一下 哪里要改謝謝啦!
uj5u.com熱心網友回復:
strsql = "Select * From 借書 where "strsql = strsql & "書名"
strsql = strsql & " LiKe '%" & Trim(Text1.Text) & "%'"
上面代碼經除錯沒有錯誤,可以查詢出記錄,如下圖。
uj5u.com熱心網友回復:
t = Option1(Index).Index
改為
For t = 1 To 3
If Option1(t).Value Then Exit For
Next
uj5u.com熱心網友回復:
dim strwhere as string
strsql=" select * from 借書 where 1=1 "
select case t
case 1
strwhere=" and 書名 like '"& trim(text1.text) &"%'"
case 2
strwhere=" and 索書號 like '"& trim(text1.text) &"%'"
case 3
strwhere=" and 作者 like '"& trim(text1.text) &"%'"
case else
strwhere=""
end select
strsql=strsql & strhwere
uj5u.com熱心網友回復:
你的 Option 控制元件名分別是 Option4、Option5、Option6。
strsql = "SELECT * FROM 借書"
If Text1 > "" Then
If Option4.Value = True Then
strsql = strsql & " WHERE 書名 LIKE '%" & Text1 & "%'"
ElseIf Option5.Value = True Then
strsql = strsql & " WHERE 索書號 LIKE '%" & Text1 & "%'"
Else
strsql = strsql & " WHERE 作者 LIKE '%" & Text1 & "%'"
End If
End If
uj5u.com熱心網友回復:
你在vb中加一句debug.print strsqlIDE環境運行后在立即視窗把顯示的sql字串復制粘貼到服務器管理端運行下,再看看是哪里的問題
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/62416.html
