标题:FROM 子句语法错误
只看楼主
sun034
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2006-5-10
 问题点数:0 回复次数:2 
FROM 子句语法错误
下面是我的代码 运行时提示 "FROM 子句语法错误" 我点确定出来 "对象'Refresh'的方法'IAdodc'失败" 这个句话 请各位大侠帮助

Private Sub MSFlexGrid1_Click()
If Trim(Me.MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 0)) = "" Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Else
Adodc1.RecordSource = "select * from 课件表 where 课件编号='" & Trim(Me.MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 0)) & "'"
Adodc1.Refresh
Text1.Text = Adodc1.Recordset.Fields(0)
Text2.Text = Adodc1.Recordset.Fields(1)
Text3.Text = Adodc1.Recordset.Fields(2)
Text4.Text = Adodc1.Recordset.Fields(3)
Text5.Text = Adodc1.Recordset.Fields(4)
Text6.Text = Adodc1.Recordset.Fields(5)
End If
End Sub
搜索更多相关主题的帖子: 子句 语法 FROM 
2006-05-10 11:08
purana
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:广东-广州
等 级:版主
威 望:66
帖 子:6039
专家分:0
注 册:2005-6-17
得分:0 
试试这样..
Private Sub MSFlexGrid1_Click()
If Trim(Me.MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 0)) = "" Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Else
Adodc1.CommandType = adCmdUnknown
Adodc1.RecordSource = "select * from 课件表 where 课件编号='" & Trim(Me.MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 0)) & "'"
Adodc1.Refresh
Text1.Text = Adodc1.Recordset.Fields(0)
Text2.Text = Adodc1.Recordset.Fields(1)
Text3.Text = Adodc1.Recordset.Fields(2)
Text4.Text = Adodc1.Recordset.Fields(3)
Text5.Text = Adodc1.Recordset.Fields(4)
Text6.Text = Adodc1.Recordset.Fields(5)
End If
End Sub

我的msn: myfend@
2006-05-10 13:16
sun034
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2006-5-10
得分:0 

多谢板主 呵呵问题已经解决了 请问加了"Adodc1.CommandType = adCmdUnknown"个是什么意思呢?

2006-05-10 13:44



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-63050-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.344826 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved