Home > Software engineering >  System, using VB and SQLSERVER2005 do MDB file can't open it
System, using VB and SQLSERVER2005 do MDB file can't open it

Time:09-25

I found this type of document in the VB directory Microsoft Access Database (MDB), open the way for Microsoft Access by default, but open and prompt to upgrade, click can transform failure, the table is some messy code, not my table in the Database, this what to do, what's next?

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
  • Related