您的位置:程序门 -> vb -> 数据库(包含打印,安装,报表)



关于adodc控件的问题!


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


关于adodc控件的问题!
发表于:2007-04-23 11:19:13 楼主
代码如下:
public   count   as   integer
    with   adodc1
                          .connectionstring   =   "dsn=jczx "
                          .username   =   "jczx1 "
                          .password   =   " "
                          .recordsource   =   "select   *   from   djqsr   where打印标志   =   '否 ' "
                          .refresh
    end   with
  for   count   =   0   to   adodc1.recordset.recordcount
                                with   adodc1.recordset
                                      text1.text   =   .fields( "铅品号 ")
                                      text2.text   =   .fields( "批号 ")
                                      text3.text   =   .fields( "生产单位 ")
                                      text4.text   =   .fields( "标准编号 ")
                                      text5.text   =   .fields( "生产日期 ")
                                      text14.text   =   .fields( "化验日期 ")
                                      text15.text   =   .fields( "化验员 ")
                                      format(text8.text,   "#0.0000% ")   =   .fields( "银ag ")
                                      format(text10.text,   "#0.0000% ")   =   .fields( "铜cu ")
                                      format(text12.text,   "#0.0000% ")   =   .fields( "锑sb ")
                                      format(text7.text,   "#0.0000% ")   =   .fields( "锡sn ")
                                      format(text9.text,   "#0.0000% ")   =   .fields( "砷as ")
                                      format(text1.text,   "#0.0000% ")   =   .fields( "铋bi ")
                                      format(text1.text,   "#0.0000% ")   =   .fields( "铁fe ")
                                      format(text1.text,   "#0.0000% ")   =   .fields( "锌zn ")
                                      format(text1.text,   "#0.0000% ")   =   .fields( "总和 ")
                                      format(text1.text,   "#0.0000% ")   =   .fields( "铅pb ")
                                      '.fields   ( "打印标志 ")= "是 "
                                      .update
                                    .movenext

                                end   with
                              form1.printform
  next   count
错误提示:编译错误,变量要求-不能赋值到该表达式
光标停留在cout上
各位大侠请赐教呀!
发表于:2007-04-23 11:33:181楼 得分:0
检查adodc1.recordset是否为nothing
发表于:2007-04-23 11:44:002楼 得分:0
感谢cathysun118(斯年)的关注.
sql语句在查询分析器里验证过了,有结果.
不应该是adodc1.recordset的问题.
请指教呀!
发表于:2007-04-23 14:18:083楼 得分:0
format(text8.text,   "#0.0000% ")   =   .fields( "银ag ")
                                      format(text10.text,   "#0.0000% ")   =   .fields( "铜cu ")
                                      format(text12.text,   "#0.0000% ")   =   .fields( "锑sb ")
                                      format(text7.text,   "#0.0000% ")   =   .fields( "锡sn ")
                                      format(text9.text,   "#0.0000% ")   =   .fields( "砷as ")
                                      format(text1.text,   "#0.0000% ")   =   .fields( "铋bi ")
                                      format(text1.text,   "#0.0000% ")   =   .fields( "铁fe ")
                                      format(text1.text,   "#0.0000% ")   =   .fields( "锌zn ")
                                      format(text1.text,   "#0.0000% ")   =   .fields( "总和 ")
                                      format(text1.text,   "#0.0000% ")   =   .fields( "铅pb ")
       
语法错了!
发表于:2007-04-23 14:35:574楼 得分:0
谢谢zou_seafarer(颓废程序员^_^)的关注.
所提建议已采纳.
修改后提示:所需操作需要一个当前记录!
但是sql语句确实在sql查询分析器里正常执行呀!

发表于:2007-04-23 14:51:295楼 得分:0
adodc1.recordset.addnew一条然后再update吧?
发表于:2007-04-23 14:52:576楼 得分:0
不好意思,没看全,无需addnew


快速检索

最新资讯
热门点击