各位大师:用SQL语句进行表的筛选时,对字段为逻辑型的表应如何表示?!!!!!如下,但出错!
Adodc1.RecordSource = "select * from 分站 where 巡检开关=" + "'" +True+ "'"
应该如何写, 请高人帮忙!!

解决方案 »

  1.   

    Access Database:
               select * from 分站 where 巡检开关=true
    SQL Server Database:
               select * from 分站 where 巡检开关=1
      

  2.   

    不同的数据库不一样的。试试下面各种格式
    "select * from 分站 where 巡检开关=1"
    "select * from 分站 where 巡检开关=-1"
    "select * from 分站 where 巡检开关='1'"
    "select * from 分站 where 巡检开关='-1'"
    "select * from 分站 where 巡检开关='Y'"