一般情况下用相对路径app.path 工程--->引用--->Microsoft ActiveX Data Object 2.x(版本号) Dim CN As New ADODB.Connection '定义数据库的连接 Dim Rs As New ADODB.Recordset CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\student.mdb" CN.Open Rs.CursorLocation = adUseClient Rs.Open "select * from employees", CN, adOpenDynamic, adLockOptimistic
工程--->引用--->Microsoft ActiveX Data Object 2.x(版本号) Dim CN As New ADODB.Connection '定义数据库的连接
Dim Rs As New ADODB.Recordset CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\student.mdb" CN.Open
Rs.CursorLocation = adUseClient
Rs.Open "select * from employees", CN, adOpenDynamic, adLockOptimistic
data1.tecordsourse="select * from 表"
data1.refresh其余的空间