findright = "select Handle,round('" & ny2 & "',1) as Cy2, round(Line*sin('" & sita1 & "'-'" & angle & "'),1) as Ry1 from prefixture " & _
             "where (round(Line*cos(Sita1-'" & angle & "')-'" & nx2 & "') between 0 and '" & MaxD & "') " & _
             "and (Handle <>'" & handle & "')" & _
             "and (round(abs(Angle-'" & angle & "'),2)=6.28 or round(Angle-'" & angle & "')=0)"这句话vb说我的round函数没有定义过,但是我直接写
select Handle from prefixture where round(Sita1,1)=98.2
在access中就找到了结果
这应该说明access中承认了round函数阿
究竟是什么原因呢?
谢谢

解决方案 »

  1.   

    你改成下面这样试试:
    findright = "select Handle," & round('" & ny2 & "',1) as Cy2,& round(Line*sin('" & sita1 & "'-'" & angle & "'),1) as Ry1 & "from prefixture " & _
                 "where (round(Line*cos(Sita1-'" & angle & "')-'" & nx2 & "') between 0 and '" & MaxD & "') " & _
                 "and (Handle <>'" & handle & "')" & _
                 "and (" & round(abs(Angle-'" & angle & "'),2)=6.28 & "or" & round(Angle-'" & angle & "')=0 & ")"
    因为round是函数,而不是字符串,你认为呢?
      

  2.   

    TO liu :这样不可以
    to:forrestSun 复杂查询要是能写成query我就已经做了
    大家帮忙啊
    谢谢
      

  3.   

    "where (round(Line*cos(Sita1-'" & angle & "')-'" & nx2 & "') between 0 and '" & MaxD & "') " & _这里的 round 是否缺了小数位参数
      

  4.   

    将所有字段名检查一下,应该是你用了Access的系统内置名称比如:有一个字段叫:name,则你在access的查询中可以进行查询,但在vb中执行就会出问题
      

  5.   

    不是缺了参数,
    Adodc1.RecordSource = "select Handle from prefixture where  round(x2,1)=11082.6  "
    我写了这样一句简单的也不可以
    大家帮帮我啊