问题描述
我正在VB6中使用具有ms访问权限的Data对象
错误消息:运行时错误3075
代码:
设置db = OpenDatabase(App.Path&"\ db.mdb")
昏暗的snrs作为记录集
设置snrs = db.OpenRecordset(从[entry]中选择*,其中[NAME] ="&Me.txtname.Text和"")
从[输入]中选择*,其中[NAME] =''"&Me.txtname.Text&''"
现在,当Me.txtname.Text
上没有Single Cote时,它的工作正常
例如,如果名称是a.b或a.c cba,除了ab's或bc's以外,实际上采石场正变得像
从[输入]中选择*,其中[NAME] =''"&bc's&''"
从[输入]中选择*,其中[NAME] =``bc''s''":现在,这将导致错误
他们的解决方案是什么,请给我建议
Hi i am using Data object in VB6 with ms access
error massage : run-time error 3075
code :
Set db = OpenDatabase(App.Path & "\db.mdb")
Dim snrs As Recordset
Set snrs = db.OpenRecordset("select * from [entry] where [NAME]= ''" & Me.txtname.Text & "''")
"select * from [entry] where [NAME]= ''" & Me.txtname.Text & "''"
now its working fine when no Single cote on Me.txtname.Text
for example if the name is a.b or a.c cba what ever except like ab''s or bc''s actually the quarry is becoming like
"select * from [entry] where [NAME]= ''" & bc''s & "''"
"select * from [entry] where [NAME]= ''bc''s''" : now this is causing an error
is their any solution for this please suggest me alternatives
推荐答案
这篇关于VB 6 Select语句问题,其中单个字符串下的字符串中包含单个字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!