vb编程,数据库“图书管理”中存在“读者表”,表结构为“编号,姓名

vb编程,数据库“图书管理”中存在“读者表”,表结构为“编号,姓名,第1张

Dim Con As New ADODB.Connection     '定义ADO对象

Dim Rs As New ADODB.Recordset

Private Sub Command1_Click()

    If Text1.Text = "" Then         '控制增加值不能为空

        MsgBox "请正确输入年龄", 48, "提示信息"

    Else

        Con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0Data Source=" & App.Path & "\student.mdbPersist Security Info=False"

        Con.Open

        Set Rs = Con.Execute("UPDATE 学生基本信息 SET 年龄= 年龄+" + Text1.Text + "")       '修改表语句

        Con.Close

    End If

    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0Data Source=" & App.Path & "\student.mdbPersist Security Info=False"  '刷新ADO控件

    Adodc1.RecordSource = "select * from 学生基本信息"

    Adodc1.Refresh

    Set DataGrid1.DataSource = Adodc1

End Sub

Private Sub Form_Load()

    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0Data Source=" & App.Path & "\student.mdbPersist Security Info=False"  '初始化ADO控件

    Adodc1.RecordSource = "select * from 学生基本信息"

    Adodc1.Refresh

    Set DataGrid1.DataSource = Adodc1

End Sub

1.select * from 读者 where 部门='法律系'

2.select 借书证号,书号,借书日期 from 借书登记 where 还书时期 is null

3.select t1.书号 , t1.还书日期-t2.借书日期 from 借书登记 t1,借书登记 t2 where t1.流水号=t2.流水号 and t1.借书证号=t2.借书证号 and t1.书号=t2.书号

4. select 书号,count(*) from 借书登记 group by 书号

5.select 出版社,sum(价格) 汇总金额 from 图书 group by 出版社 order by sum(价格) desc


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/9909506.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-03
下一篇 2023-05-03

发表评论

登录后才能评论

评论列表(0条)

保存