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



看看:对象refrash方法 “iadodc”失败


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


看看:对象refrash方法 “iadodc”失败
发表于:2007-11-21 17:55:43 楼主



private   sub   cmdstart_click()

    set   datagrid1.datasource   =   adocustomer
    adocustomer.recordsource   =   "select   *   from   customer   where   姓名   like   '%   "   &   txtfirname.text   &   "%'"

    adocustomer.refresh----这里调试时是黄色的,之前我是直接用adocutstomer在属性栏设置的连接,查询时没有问题;可当我把连接改为用form_load时就报这个错了,实在郁闷!
         
      if   adocustomer.recordset.bof   =   false   then
        msgbox   "该客户不存在!",   vbokonly,   "提示"
      end   if
      if   txtfirname.text   =   ""   then
          msgbox   "请输入查询姓氏!",   vbokonly,   "提示"
      end   if
         
end   sub

错误:先是提示我:adocustomer的from子句语法错误,然后我点确定,又提示我:实时错误:-2147217900   对象refrash方法   “iadodc”失败!
究竟哪错了啊!~
发表于:2007-11-22 10:22:351楼 得分:0
自己顶!
发表于:2007-11-23 09:52:552楼 得分:0
我哭啊!没人鸟我
发表于:2007-11-26 10:20:363楼 得分:0
wuwu!~
发表于:2007-11-29 10:36:164楼 得分:0
不是很懂你的意思  

private   sub   form_load()
call   con
end   sub


public   sub   con()
dim   sele   as   string
sele   =   "select   id   as'编号',company   as   '注册公司'   ,name   as   '注册名称'   ,register   as   '注册码'   from   registerinfo"
adodc1.connectionstring   =   "provider=sqloledb.1;password=sa;persist   security   info=true;user   id=sa;initial   catalog=usbkey;data   source=."
adodc1.recordsource   =   sele
adodc1.refresh
datagrid1.refresh
end   sub

不知道对你有没有帮助
发表于:2007-11-29 13:17:295楼 得分:0
vbscript code
adocustomer.recordsource = "select * from customer where 姓名 like '" & txtfirname.text & "%'"
发表于:2007-11-30 17:33:056楼 得分:0
不行啊,附件传不了啊
太不好了
发表于:2007-12-03 09:51:147楼 得分:0
解决了,写条语句:adocustomer.commandtype=adcmdtext就可以了


快速检索

最新资讯
热门点击