创建一个应用程序,能对Access数据库文件中的数据进行增、删、改和查询操作(查询必须使用SQL语句)

把那个编译好的发给我就行了,谢谢

Dim a As String
Private Sub Combo1_Click()
If Combo1.ListIndex = 0 Then
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = False
Combo3.Enabled = False
ElseIf Combo1.ListIndex = 1 Then
Text3.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Combo3.Enabled = False
ElseIf Combo1.ListIndex = 2 Then
Combo3.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
End IfEnd SubPrivate Sub Command1_Click()
If Combo1.ListIndex = -1 Then
MsgBox "请选择查询方式", , "提示"
ElseIf Combo1.ListIndex = 0 Then
Adodc1.CommandType = adCmdUnknown
If Text2.Text = "" Then
MsgBox "查询范围上限不可为空", , "提示"
Else
Adodc1.RecordSource = "select * from 基本信息 where 年龄>= " & Text1.Text & " and 年龄<= " & Text2.Text & " "
Adodc1.Refresh
End If
ElseIf Combo1.ListIndex = 1 Then
Adodc1.CommandType = adCmdUnknown
If Text3.Text = "" Then
MsgBox "确定内容为空?"
Adodc1.RecordSource = "select*from 基本信息 where 学号='" & Text3.Text & "'"
Adodc1.Refresh
Else
Adodc1.RecordSource = "select*from 基本信息 where 学号='" & Text3.Text & "'"
Adodc1.Refresh
End If
ElseIf Combo1.ListIndex = 2 Then
Adodc1.CommandType = adCmdUnknown
Adodc1.RecordSource = "select * from 基本信息 where 专业='" & Combo3.Text & "' "
Adodc1.Refresh
End IfEnd SubPrivate Sub Command2_Click()
Adodc1.Recordset.AddNew
End SubPrivate Sub Command3_Click()
Adodc1.Recordset.Delete
End SubPrivate Sub Command4_Click()
Adodc1.CommandType = adCmdUnknown
Adodc1.RecordSource = "select * from 基本信息"
Adodc1.Refresh
End SubPrivate Sub Command5_Click()
a = InputBox("请输入查询对象字段", "自定义查询")
Adodc1.CommandType = adCmdUnknown
Adodc1.RecordSource = "select*from 基本信息 where a"
Adodc1.Refresh
End SubPrivate Sub Form_Load()
Adodc1.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" + App.Path + "\" + "学生数据库.mdb"
Adodc1.CommandType = adCmdUnknown
Adodc1.RecordSource = "select * from 基本信息"
Adodc1.Refresh
End Sub
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-08-30
首先你的需求分析都没告诉,到底要做什么,建立什么表,要些什么字段都没说,而且要什么语言写的应用程序也没说,有些程序需要框架来支持,请你详细一点
第2个回答  2013-08-30
我发给你
相似回答
大家正在搜