我用
microsoft access driver(*.mdb)进行连接;在vb中用recordset = cn.execute (select a.* from a where a.name = '张三'
),结果正确。
改为
recordset = cn.execute (select a.* from a where a.name like '*张三*')
后记录集无内容,为什么?是vb的原因?select a.* from a where a.name like '*张三*' 在access中查询结果也正确
microsoft access driver(*.mdb)进行连接;在vb中用recordset = cn.execute (select a.* from a where a.name = '张三'
),结果正确。
改为
recordset = cn.execute (select a.* from a where a.name like '*张三*')
后记录集无内容,为什么?是vb的原因?select a.* from a where a.name like '*张三*' 在access中查询结果也正确
这样试一下!!
recordset = cn.execute (select a.* from a where a.name like '*张三*')
改为
recordset = cn.execute (select a.* from a where a.name like '%张三%')
即可!但是(select a.* from a where a.name like '%张三%') 直接在access中执行是无结果的,不知道什么原因
cn.execute ("select * from a where a.name like " & "'" & "*张三*" & "'")
不仅只用语sql serve!
严重同意楼上的同志.
DAO用 * 你用的是ADO