vb怎么连接access数据库
展开全部
AccessStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "ITCClient.mdb"
AccessTest (AccessStr)
Function AccessTest(s As String) As String
Dim i As Long
Dim c As New ADODB.Connection
Dim r As New ADODB.Recordset
c.Open s
r.Open "select top 10 * from MVC_DATA", c
If r.State = 1 Then
Do While Not r.EOF
Debug.Print "**-------------------------------------------------**"
For i = 0 To r.Fields.Count - 1
Debug.Print r.Fields(i).Value
Next
r.MoveNext
Loop
End If
If r.State <> 0 Then r.Close
If c.State <> 0 Then c.Close
Set r = Nothing
Set c = Nothing
End Function
AccessTest (AccessStr)
Function AccessTest(s As String) As String
Dim i As Long
Dim c As New ADODB.Connection
Dim r As New ADODB.Recordset
c.Open s
r.Open "select top 10 * from MVC_DATA", c
If r.State = 1 Then
Do While Not r.EOF
Debug.Print "**-------------------------------------------------**"
For i = 0 To r.Fields.Count - 1
Debug.Print r.Fields(i).Value
Next
r.MoveNext
Loop
End If
If r.State <> 0 Then r.Close
If c.State <> 0 Then c.Close
Set r = Nothing
Set c = Nothing
End Function
网易云信
2023-12-06 广告
2023-12-06 广告
UIkit是一套轻量级、模块化且易于使用的开源UI组件库,由YOOtheme团队开发。它提供了丰富的界面元素,包括按钮、表单、表格、对话框、滑块、下拉菜单、选项卡等等,适用于各种类型的网站和应用程序。UIkit还支持响应式设计,可以根据不同...
点击进入详情页
本回答由网易云信提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询