
在设计视图中打开表T1
选择字段A
输入有该字段的有效性规则
>=1 And <=200 And [a]*10 Mod 5=0
限制小数点的位数不用讲了吧...
给个参考,这句的意思是从学生信息表中选择满足学号为'" &Trim(Combo1.Text) &"' 而且 课程为'" &Trim(Combo2.Text) &"'而且 班级 = '" &Trim(Combo3.Text) &"' 的任意*信息给记录集Adodc1.RecordSource。 { 其中Trim()用来去除字符串两边的空格.。再一个就是and条件的格式 : 条件1 and (条件2 and 条件3) }Adodc1.RecordSource = " select * from 学生信息表 where 学号 = '" &Trim(Combo1.Text) &"' and ( 课程 ='" &Trim(Combo2.Text) &"' and班级 = '" &Trim(Combo3.Text) &"' ) "
in 关键字组成的 条件格式,类似与or ,如下sql所示
select * from [表名] where [列名] in ('a','b','c')/*等价于以下sql脚本*/
select * from [表名] where [列名] ='a'
union all
select * from [表名] where [列名] ='b'
union all
select * from [表名] where [列名] ='c'
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)