vb6.0+win2000(求帮助)
问题1、如何把窗体form1中的dim sgm as string,sgm=text1.text的内容赋给DataReport中的LABEL1.caption(或text1.text),以便打印出来。
问题2、把窗体form1中的变量 dim sq as string ,sq=text1.text,如何在dataenvironment1中的 sql=select * from table where dj.wjdm=de.wjdm and wjdm="'+sq+'"双重查询中运用?我的做法错在哪里?

解决方案 »

  1.   

    sql=select * from table where dj.wjdm=de.wjdm and wjdm="'+sq+'"dj?
    de?
      

  2.   

    sql=select * from dj,de where dj.wjdm=de.wjdm and wjdm="'+sq+'"
      

  3.   

    你太懒了.
    直接控制打印多好,用DataReport不够灵活.
    在保证form1已 load 的情况下 DataReport名.LABEL1.caption=form1.text1.text应该可以搞掂(你声明的sgm有点多余,该偷懒时不偷懒,至少要用Public).
    第二个问题有类似的问题.建议你别用ataenvironment,直接在窗体用 SQL 语句.灵活、直观!
      

  4.   

    问题一:用datareport比较方便
    问题二 sql=select * from dj,de where dj.wjdm=de.wjdm and de,wjdm="'+sq+'"
      

  5.   

    问题一、DataReport名.LABEL1.caption=form1.text1.text试了不行!
    问题二 sql=select * from dj,de where dj.wjdm=de.wjdm and de,wjdm="'+sq+'"也不行,去掉and de,wjdm="'+sq+'"后就都有了?说明没有成功!