1、加号,连接,相当于&,将字符串连接起来:
Adodc1.RecordSource = “select * from tb_user where 操作员='” & StatusBar1.Panels(4).text & “‘”
2、单引号:
access数据库中,若字段类型为字符串,用单引号:
Adodc1.RecordSource = “select * from tb_user where 操作员=’张三'”
若字段类型为日期,用#:
Adodc1.RecordSource = “select * from tb_user where 日期>=#2011-1-1#”
若字段类型为数值,啥也不用:
Adodc1.RecordSource = “select * from tb_user where 登录次数>100”
3、双引号,表示那是一段字符串:
c=”aaa” & b & “aaa” ,表示将变量b的前后加个字符aaa后赋值给变量c