'数据库名假设TEST dim strsql As String dim db As ADODB.Connection dim rst As New ADODB.Recordset dim dbconStr as string '连接ACCESS数据库dbconStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & _ "\TEST.MDB" & ";Jet OLEDB:Database Password= " db.open dbconstr'根据条件获取记录信息 strsql="select 成绩 from TEST where 姓名='" & combo1.text & "' and 科目='" & combo2.text & "'" call db.Execute(strsql,rst) text1.text=rst.Fields("成绩").Value
'数据库名假设TEST
dim strsql As String
dim db As ADODB.Connection
dim rst As New ADODB.Recordset
dim dbconStr as string
'连接ACCESS数据库dbconStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & _
"\TEST.MDB" & ";Jet OLEDB:Database Password= "
db.open dbconstr'根据条件获取记录信息
strsql="select 成绩 from TEST where 姓名='" & combo1.text & "' and 科目='" & combo2.text & "'"
call db.Execute(strsql,rst)
text1.text=rst.Fields("成绩").Value