vb电脑已经没有了,很简单的程序。自己研究一下做做.
步骤:
1.连接数据库
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_ExpStu.mdb;Persist Security Info=False"
’连接字符串
Adodc1.RecordSource = "select * from tb_stu " ‘查询所有数据
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1 ‘在DATAGRID1中显示出来
2.查询
查询主要代码
Private Sub Cmd_Find_Click()
If Text1.Text = "" Then
MsgBox "请输入要查询的学生编号", , "信息提示"
Text1.Text = ""
Text1.SetFocus
Exit Sub
Else
MyInt = Val(Trim(Text1.Text)) '给变量赋值
Adodc1.RecordSource = "select * from tb_stu where 年龄= " + Str(MyInt) + ""
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End If
End Sub
本文地址: http://www.goggeous.com/d/1/616821
文章来源:天狐定制
版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。
2025-01-08职业培训
2025-01-08职业培训
2025-01-08职业培训
2025-01-08职业培训
2025-01-08职业培训
2025-01-08职业培训
2025-01-08职业培训
2025-01-08职业培训
2025-01-08职业培训
2025-01-08职业培训
2024-12-14 15:59:41职业培训
2024-12-14 15:59:41职业培训
2024-12-14 15:59:40职业培训
2024-12-14 15:59:39职业培训
2024-12-14 15:59:38职业培训
2024-12-14 15:59:29职业培训
2024-12-14 15:59:28职业培训
2024-12-14 15:59:28职业培训
2024-12-14 15:59:27职业培训
2024-12-14 15:59:26职业培训
2024-12-15 06:24职业培训
2024-12-23 21:19职业培训
2025-01-08 00:29职业培训
2025-01-02 14:23职业培训
2024-12-05 22:30职业培训
2025-01-01 12:40职业培训
2024-12-02 02:23职业培训
2024-12-18 03:24职业培训
2024-12-04 17:15职业培训
2024-12-15 16:13职业培训
扫码二维码
获取最新动态