System.Data.OleDb.OleDbException: 无效的授权说明在vb中 这是什么错误
源代码如下:PrivateSubselectCon()DimdiAsNewIO.DirectoryInfo(".")DimpathAsStringpath=di.Full...
源代码如下:
Private Sub selectCon()
Dim di As New IO.DirectoryInfo(".")
Dim path As String
path = di.FullName() & "\YHTH_NEW.mdb"
strCon = "Provider=SQLOLEDB;Data Source=" & path
cn = New OleDb.OleDbConnection(strCon)
sql = "select * from test"
da = New OleDb.OleDbDataAdapter(sql, cn)
ds = New DataSet
da.Fill(ds, "EnglishTable")
recordN = ds.Tables("EnglishTable").Rows.Count
End Sub 展开
Private Sub selectCon()
Dim di As New IO.DirectoryInfo(".")
Dim path As String
path = di.FullName() & "\YHTH_NEW.mdb"
strCon = "Provider=SQLOLEDB;Data Source=" & path
cn = New OleDb.OleDbConnection(strCon)
sql = "select * from test"
da = New OleDb.OleDbDataAdapter(sql, cn)
ds = New DataSet
da.Fill(ds, "EnglishTable")
recordN = ds.Tables("EnglishTable").Rows.Count
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询