查询数据代码出现问题
各位网友好,现有一窗体作为查询界面,根据资料书写代码如下Public Class Form1
Dim mybind As BindingManagerBase
Dim strconn As String = "provider=microsoft.jet.oledb.4.0;data source=mingdan.mdb"
Dim objconn As New oledbconnection(strconn)
Dim objadap As New oledbdataadapter
Dim objdset As New DataSet
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strsql As String
objconn.open()
objdset.Clear()
If Trim(TextBox1.Text) = "" Then
strsql = "select * from huojiang"
Else
strsql = "select * from huojiang where 获奖等级='" & TextBox1.Text & "'"
End If
Dim objadap As New oledbdataadapter(strsql, objconn)
objconn.close()
objadap.fill(objdset, "huojiang")
DataGridView1.DataSource = objdset.Tables("huojiang")
End Sub
End Class
运行时提示如下
错误 1 未定义类型“oledbconnection”
错误 2 未定义类型“oledbdataadapter”
错误 3 未定义类型“oledbdataadapter”
请问错在哪里,应如何处理 。
查询记录.rar
(42.59 KB)
请指导,谢谢
程序在附件中
[ 本帖最后由 燕之峰 于 2014-11-19 15:57 编辑 ]