在vb6中使用ADODB.Recordset查找字段的一部分
我在 mdb 中有一个带有字段地址的表,其中包含街道地址等字符串。 我希望能够搜索该记录的部分内容。
sCriteria = "address like " & "'" & streetAddr & "'"
Rs1.Filter = sCriteria
它搜索例如“Mall”,而有一条记录“Mall Road”应该已找到,但由于道路丢失而没有找到,我应该做什么才能使部分字段可搜索
I have a table in mdb with field address, which will contain street address e.t.c as string.
I want to be able to search part of this record.
sCriteria = "address like " & "'" & streetAddr & "'"
Rs1.Filter = sCriteria
it searches for e.g "Mall" while there is a record "Mall Road" which should have been found but is not as Road is missing, what should i do to make part of field searchable
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
Quote
执行简单的Replace(sText, "'", "''")
Try
where
Quote
does a simpleReplace(sText, "'", "''")
在过滤器值之后、右单引号之前放置一个“*”。
Put an '*' before the closing single-quote, after the filter value.