|
|
|
|
|
|
n*****n 发帖数: 4 | 1 在 DAO中 好 用 的 SQL:"select * from db where field like
'我要查的*'"
在 ADO中 没 法 用 , 查 不 到 。
DAO我 用 的 语 句 生 成 的 recordset, ADO用 的 是 AdoDB的 控 件 。
用 完 完 全 全 同 样 的 语 句 ,
在 DAO生 成 的 recordset中 查 到 三 条 ,
而 ADO中 是 一 条 也 查 不 到 。
也 不 要 说 我 数 据 连 接 有 问 题 , 我 不 会 出 这 样 的 错 。
adodb.recordsource="select * from xx where field like 'xx*'"
我 知 道 问 题 出 在 *上 面 ,因 为 我 用 等 号 时 没 有 问 题 ,
可 这 样 一 来 就 实 现 不 了 ADO下 的 模 糊 查 询 。
怎 么 ADO比 DAO要 新 , 为 什 么 就 实 现 不 了 like的 带 *的 查 询
了 呢 ?
还 | s*****e 发帖数: 854 | 2
。
In SQL standard, the wild char is '%' rather than '*'. You may give
it a try.
【在 n*****n 的大作中提到】 : 在 DAO中 好 用 的 SQL:"select * from db where field like : '我要查的*'" : 在 ADO中 没 法 用 , 查 不 到 。 : DAO我 用 的 语 句 生 成 的 recordset, ADO用 的 是 AdoDB的 控 件 。 : : 用 完 完 全 全 同 样 的 语 句 , : 在 DAO生 成 的 recordset中 查 到 三 条 , : 而 ADO中 是 一 条 也 查 不 到 。 : 也 不 要 说 我 数 据 连 接 有 问 题 , 我 不 会 出 这 样 的 错 。 : adodb.recordsource="select * from xx where field like 'xx*'"
|
|
|
|
|
|