- 积分
- 17
- 在线时间
- 19 小时
- 主题
- 0
- 注册时间
- 2016-9-29
- 帖子
- 21
- 最后登录
- 2021-11-22
- 帖子
- 21
- 软币
- 241
- 在线时间
- 19 小时
- 注册时间
- 2016-9-29
|
发表于 2017-1-8 11:30:59
|
显示全部楼层
Try
dbProvider = "Provider=Microsoft.ACE.OLEDB.12.0;"
dbSource = "Data Source=" & dbFileDir
Using db_AccessCon As OleDbConnection = New OleDbConnection(dbProvider & dbSource)
db_AccessCon.Open()
Using Access_Dataset As DataSet = New DataSet
Using Access_CMD As OleDbCommand = New OleDbCommand(cmdString, db_AccessCon)
Access_CMD.CommandTimeout = ProcessTime
Using Access_Adapter As OleDbDataAdapter = New OleDbDataAdapter(Access_CMD)
Using EMBuilder As OleDbCommandBuilder = New OleDbCommandBuilder(Access_Adapter)
Access_Adapter.Fill(Access_Dataset, cmdTable) ' Access_Adapter.FillSchema(AccessDataset, SchemaType.Source)
End Using
End Using
End Using
Return Access_Dataset.Tables(0)
End Using
End Using
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, ErrorString & " Error")
Return Nothing
Finally
End Try |
|