CodePudding user response:
In VB to open Access database need connection, don't know you is what circumstance, can also Access database operation in 2005 system,CodePudding user response:
Private Sub Command1_Click ()
'On the Error Resume Next
Dim cn As New ADODB. Connection
Dim fsofile
If cn. State & lt;> 0 Then cn. Close
The Set cn=Nothing
The Set fsofile=CreateObject (" scripting. Filesystemobject ")
CommonDialog1. Filter="MDB files (*. MDB) | *. MDB"
CommonDialog1. CancelError=True
On Error GoTo myerr
CommonDialog1. ShowSave
Fsofile. Used by copyfile App. Path & amp; "\ FDCPGGL MDB," CommonDialog1. FileName
Dim the connectionstring As String
The connectionstring="provider=Microsoft. Jet. The oledb. 4.0;" & _
"Data source=" & amp; App. The Path & amp; "\ FDCPGGL MDB
"Cn. Open the connectionstring
The Exit Sub
Myerr:
End Sub