我在此SQL查询中收到语法错误。
s2 = "select * from Seats where train name like '" & trains.lbl4.Caption & "' and train no like " & trains.lbl3.Caption
请帮我识别语法错误
答案 0 :(得分:0)
select * from Seats where [train name] like '" & trains.lbl4.Caption & "%' and [train no] like '" & trains.lbl3.Caption & "%'"
这应该做到
如果您有匹配的确切值,请使用此select语句:
select * from Seats where [train name] ='" & trains.lbl4.Caption & "' and [train no] = '" & trains.lbl3.Caption & "'"