在使用dataenvironment作为datareport的数据源,使用command作为datamember,如何动态改变command,而不是事前绑定?能否提供代码?谢谢!

vb_girl 2002-10-30 01:16:09
我在按钮事件中动态改变command1,但不能绑定数据?
Private Sub Command1_Click()
sql = "select * from 学生1"
DataEnvironment1.Commands("command1").CommandType = adCmdTable
DataEnvironment1.Commands("command1").CommandText = "sql"
Set DataReport1.DataSource = DataEnvironment1
DataReport1.DataMember = "command1"
MsgBox DataReport1.Sections("Section1").Controls(1).Name
DataReport1.Sections("Section1").Controls(1).DataMember = "command1"
DataReport1.Sections("Section1").Controls(1).DataField = "字段1"
DataReport1.Show
End Sub
...全文
28 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

809

社区成员

发帖
与我相关
我的任务
社区描述
VB 多媒体
社区管理员
  • 多媒体
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧