form2.adodc1.RecordSource="select * from DBStudent "_
&"where 姓名=' " & Form1.Adodc1.Recordset.Fields("姓名") & " ' "
form2.adodc1.refresh出现执行错误:
Method 'refresh' of object 'IAdodc' failed请问这是为什么呢
是不是where语句出现了错误?该怎么写where语句呢?
&"where 姓名=' " & Form1.Adodc1.Recordset.Fields("姓名") & " ' "
form2.adodc1.refresh出现执行错误:
Method 'refresh' of object 'IAdodc' failed请问这是为什么呢
是不是where语句出现了错误?该怎么写where语句呢?
&"where 姓名=' " & Form1.Adodc1.Recordset.Fields("姓名") & " ' "
form2.adodc1.refresh你在这个地方逻辑出了问题Form1.Adodc1.Recordset.Fields("姓名") & " ' 这个是个数据集合,就是说是Form1.Adodc1通过查询选出来的数据集和,里面可能有张三,李四,王二麻子....select * from DBStudent "_
&"where 姓名=' " & Form1.Adodc1.Recordset.Fields("姓名") & " ' 这个sql放在这里就不成立了
如果是这样
select * from DBStudent "_
&"where 姓名='张三' or 姓名='李四' "
这样就好了具体怎么改,还要根据需要。
的作用是在form1中选择一个姓名,然后在form2中显示对应于该姓名的记录这个是逻辑问题吗,我觉得逻辑上好象没有错误,不知道错在哪儿,请高手指教,谢谢
&"where 姓名=' " & Form1.txtName.Value & " ' "
在form1得文本框中输入姓名却是可以刷新得,这是为什么呢
&"where 姓名=' " & Form1.txtName.Text & " ' "
~~~~~刚刚打错了
在form1得文本框中输入姓名却是可以刷新得,这是为什么呢
Adodc2.RecordSource = "select * from DBStudent where 姓名= '" & form1.Adodc1.Recordset.Fields.Item("姓名").Value & "' " Adodc1.Recordset.MoveNext
Loop基本上应该是这样了
但这样的效率不高
楼主自己想办法吧
就是你在Adodc1前要+上 form1
&"where 姓名=' " & Form1.txtName.Value & " ' "
form2.adodc1.RecordSource="select * from DBStudent "_
&"where 姓名=' " & Form1.Adodc1.Recordset.Fields("姓名") & " ' "这两个的语法是一样的,为什么上面的可以执行,下面的却出错呢?
&"where 姓名=' " & Form1.Adodc1.Recordset.Fields("姓名") & " ' "
form2.adodc1.refresh标准表达式中数据执行错误
~~~~~~~~~~~~~~~~~~~~~~~~~~~~这句话是什么意思呢??
出现执行错误:
Method 'refresh' of object 'IAdodc' failed