vb.net读取Access数据库的方法
2个回答
展开全部
Dim i As Integer = 0
Dim s() As string
Dim strconn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../data.mdb;Jet OLEDB:Database Password=*****"
Dim conn As OleDbConnection = New OleDbConnection(strconn)
Dim sqlstr As String = "select * from data "
Dim comm As OleDbCommand = New OleDbCommand(sqlstr, conn)
conn.Open()
Dim r As OleDbDataReader = comm.ExecuteReader()
Do While r.Read
ReDim Preserve s(num)
s(num)=r.("index0")
loop
Dim s() As string
Dim strconn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../data.mdb;Jet OLEDB:Database Password=*****"
Dim conn As OleDbConnection = New OleDbConnection(strconn)
Dim sqlstr As String = "select * from data "
Dim comm As OleDbCommand = New OleDbCommand(sqlstr, conn)
conn.Open()
Dim r As OleDbDataReader = comm.ExecuteReader()
Do While r.Read
ReDim Preserve s(num)
s(num)=r.("index0")
loop
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询