1.怎么样判断一个新输入的数据(关键几个字段)是否重复,如果重复添加无效。(ADO+access)
2.怎么样统计出符合“几个筛选字段”条件的数据个数啊?(ADO+access)
text1.text=Adodc1.RecordSource = "select count.....应该是这样吧但后面不会了。
例如;字段值
班级 性别 成绩
1 男 优秀
1 女 及格
1 男 优秀
2 女 及格
2 男 优秀
2 女 及格
查询出1班男生优秀人数
2.怎么样统计出符合“几个筛选字段”条件的数据个数啊?(ADO+access)
text1.text=Adodc1.RecordSource = "select count.....应该是这样吧但后面不会了。
例如;字段值
班级 性别 成绩
1 男 优秀
1 女 及格
1 男 优秀
2 女 及格
2 男 优秀
2 女 及格
查询出1班男生优秀人数
Msgbox Err.Description
(2)查询语句:
adodc1.recordsource="select * from Tablename where 性别='男' and 成绩='优秀'"
text1.text=str(adodc1.recordset.recordcount)
adodc1.recordsource="select count(*) as rs from Tablename where 性别='男' and 成绩='优秀'"
text1.text=adodc1.recordset!rs
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My Documents\--我的工程--\我的工程\学生.mdb;Persist Security Info=False"
Adodc1.RecordSource = "学生"
Adodc1.Refresh
Adodc1.RecordSource = "select * from 学生 where 班级='一班'and 成绩='优秀'"
Adodc1.Refresh
Text1.Text = str(Adodc1.Recordset.RecordCount)
End Sub
为什么说我语法错误啊, 是不是我的数据库加载的不对啊
你们两个的查询语句应该没有毛病啊
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My Documents\--我的工程--\我的工程\学生.mdb;Persist Security Info=False"
Adodc1.RecordSource = "学生"
Adodc1.Refresh
Adodc1.RecordSource = "select * from 学生 where 班级='一班'and 成绩='优秀'"
Adodc1.Refresh
Text1.Text = str(Adodc1.Recordset.RecordCount)
End Sub
为什么说我语法错误啊, 是不是我的数据库加载的不对啊
你们两个的查询语句应该没有毛病啊
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My Documents\--我的工程--\我的工程\学生.mdb;Persist Security Info=False"
Adodc1.RecordSource = "学生"
Adodc1.Refresh
Adodc1.RecordSource = "select * from 学生 where 班级='一班'and 成绩='优秀'"
Adodc1.Refresh
Text1.Text = str(Adodc1.Recordset.RecordCount)
End Sub
为什么说我语法错误啊, 是不是我的数据库加载的不对啊
你们两个的查询语句应该没有毛病啊
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My Documents\--我的工程--\我的工程\学生.mdb;Persist Security Info=False"
Adodc1.RecordSource = "学生"
Adodc1.Refresh
Adodc1.RecordSource = "select * from 学生 where 班级='一班'and 成绩='优秀'"
Adodc1.Refresh
Text1.Text = str(Adodc1.Recordset.RecordCount)
End Sub
为什么说我语法错误啊, 是不是我的数据库加载的不对啊
你们两个的查询语句应该没有毛病啊
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My Documents\--我的工程--\我的工程\学生.mdb;Persist Security Info=False"
Adodc1.RecordSource = "学生"
Adodc1.Refresh
Adodc1.RecordSource = "select * from 学生 where 班级='一班'and 成绩='优秀'"
Adodc1.Refresh
Text1.Text = str(Adodc1.Recordset.RecordCount)
End Sub
为什么说我语法错误啊, 是不是我的数据库加载的不对啊
你们两个的查询语句应该没有毛病啊
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My Documents\--我的工程--\我的工程\学生.mdb;Persist Security Info=False"
Adodc1.RecordSource = "学生"
Adodc1.Refresh
Adodc1.RecordSource = "select * from 学生 where 班级='一班'and 成绩='优秀'"
Adodc1.Refresh
Text1.Text = str(Adodc1.Recordset.RecordCount)
End Sub
为什么说我语法错误啊, 是不是我的数据库加载的不对啊
你们两个的查询语句应该没有毛病啊
上面的代码如果是查询一个项目的话是可以执行的,但是查询两个就出问题了,说表达式不对。
班级='一班'and 成绩='优秀'