select id from lockip where startip<= "&num_ip&" and endip >=" & num_ip
错误类型:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
列名 'startip' 无效。
select id from lockip where int(startip)<= "&num_ip&" and int(endip) >=" & num_ip
int不识别的函数
select id from lockip where Convert(startip)<= "&num_ip&" and Convert(endip) >=" & num_ip
这句的写法不知道对不对 返回结果是:
错误类型:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
第 1 行: ')' 附近有语法错误

解决方案 »

  1.   

    列名 'startip' 无效。
    这个肯定是你的列名有问题啊!select id from lockip where Convert(startip)<= "&num_ip&" and Convert(endip) >=" & num_ip
    这句应该这样改select id from lockip where cast(startip as int)<= "&num_ip&" and cast(endip as int) >=" & num_ip
      

  2.   

    前台的SQL?调试出SQL后,直接在查询分析器中运行。
      

  3.   

    select id from lockip where startip<= "&num_ip&" and endip >=" & num_ip
    --楼主可以将以上这句改成between...and..." select id from lockip where "&num_ip&" between startip and endip"
      

  4.   

    select id from lockip where startip<= 'num_ip' and endip >='num_ip'
    列名 'startip' 无效?列名错了?select id from lockip where cast(startip as int)<= num_ip and cast(endip as int) >= num_ip
    int不识别的函数