调试程序提示 在 ConnectionString 中未指定 OLE DB 提供程序,请高手指点
Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim constr As String
Dim selectcmd As String
Dim i As Integer
constr = "Provide=Microsoft.Jet.OleDb.4.0;Data Source=e:\vb\acbiao.mdb"
selectcmd = "select * from score"
Dim con As OleDbConnection
Dim cmd As OleDbCommand
Dim reader As OleDbDataReader
con = New OleDbConnection(constr)
con.Open()
cmd = New OleDbCommand(selectcmd, con)
reader = cmd.ExecuteReader()
For i = 0 To reader.FieldCount - 1
TextBox1.Text &= reader.GetName(i) & vbTab
Next