set rs=conn.execute("select tcpip,name From "&jd_table&"ip"&" where tcpip='"&reip&"'")我要在表ip中查找tcpip的值等于变量reip的tcpip和name。这语句对吗?

解决方案 »

  1.   

    select * from 表名 where tcpip=reip 
    不就可以了吗?
      

  2.   

    select tcpip,name from 表名 where tcpip=reip 
    也一样啊
      

  3.   

    具体:select tcpip,name from 表名 where tcpip='"& reip &"'刚看错了,嘿嘿,
      

  4.   

    "select tcpip,name from 表名 where tcpip='"& reip &"'"如果那个变量是int类型的话,语句如下:
    "select tcpip,name from 表名 where tcpip="& reip
      

  5.   

    如果tcpip是varchar类型的则
    set rs=conn.execute("select tcpip,name From ip where tcpip='"& reip &"'")
    如果tcpip是int类型的则
    set rs=conn.execute("select tcpip,name From ip where tcpip="& reip)
    //********************************
    你这个"&jd_table&"是干吗的,如果是变量的话,则,如下
    如果tcpip是varchar类型的则
    set rs=conn.execute("select tcpip,name From "& jd_table &"ip where tcpip='"& reip &"'")
    如果tcpip是int类型的则
    set rs=conn.execute("select tcpip,name From "& jd_table &"ip where tcpip="& reip)
    记得中间要加空格,不然会出错