我下一步该如何操作了?
我建了一个数据库,里面有一个表a1,现在我拷贝了一个同样的数据库,并且想打开它,下一步该如何呢?我的部分代码:
Public Function ConnectString(ByVal InInfo As String) As String
Dim cnn As ADODB.Connection
Dim rstStu As ADODB.Recordset
Dim strCnn As String
Dim cat As ADODB.Connection
Set cnn = New ADODB.Connection
strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "data source=" & App.Path & "\db1.mdb"
cnn.Open strCnn
Set rstStu = New ADODB.Recordset
rstStu.Open "a1", cnn, , , adCmdTable
If Dir(App.Path & "\db2.mdb") <> "" Then
Kill App.Path & "\db2.mdb"
End If
FileCopy App.Path & "\db1.mdb", App.Path & "\db2.mdb"