G
Giovanni Roi
Enviroment: Access 2007
I try this code to compact a Access 2007 Data base Back-end:
----------------------------------------------------------------------
Function UTICompatta_DBADO()
Dim CONN As JRO.JetEngine
Dim CONN_Sorg As String
Dim CONN_Dest As String
'Screen.MousePointer = vbHourglass
On Error GoTo ConnectionError
Set CONN = New JRO.JetEngine
If Dir("C:\Test\New_test_be.Accdb") <> "" Then
Kill "C:\Test\New_test_be.Accdb"
End If
CONN_Sorg = "Provider=Microsoft.Jet.OLEDB.5.0;Data
Source=C:\Test\Test_be.Accdb;Database Password=test;"
CONN_Dest = "Provider=Microsoft.Jet.OLEDB.5.0;Data
Source=C:\Test\New_test_be.Accdb;Jet OLEDB:Engine Type=5;"
CONN.CompactDatabase CONN_Sorg, CONN_Dest
Set CONN = Nothing
If Dir("C:\Test\Test_be.Accdb") <> "" And
Dir("C:\Test\New_test_be.Accdb") <> "" Then
Kill "C:\Test\Test_be.Accdb"
FileCopy "C:\Test\New_test_be.Accdb", "C:\Test\Test_be.Accdb"
End If
On Error GoTo 0
'Screen.MousePointer = vbDefault
ExitError:
Exit Function
ConnectionError:
Screen.MousePointer = vbDefault
MsgBox " VB #" & Err.Number & " " & Err.Description & " " & Err.Source
Resume ExitError
End Function
------------
and I have this error message :
" VB # -2147221164 Interfaccia non registrata.Microsoft OLE DB Service
Component"
Can You help me to solve this problem?
Thank's
Giovanni Roi
I try this code to compact a Access 2007 Data base Back-end:
----------------------------------------------------------------------
Function UTICompatta_DBADO()
Dim CONN As JRO.JetEngine
Dim CONN_Sorg As String
Dim CONN_Dest As String
'Screen.MousePointer = vbHourglass
On Error GoTo ConnectionError
Set CONN = New JRO.JetEngine
If Dir("C:\Test\New_test_be.Accdb") <> "" Then
Kill "C:\Test\New_test_be.Accdb"
End If
CONN_Sorg = "Provider=Microsoft.Jet.OLEDB.5.0;Data
Source=C:\Test\Test_be.Accdb;Database Password=test;"
CONN_Dest = "Provider=Microsoft.Jet.OLEDB.5.0;Data
Source=C:\Test\New_test_be.Accdb;Jet OLEDB:Engine Type=5;"
CONN.CompactDatabase CONN_Sorg, CONN_Dest
Set CONN = Nothing
If Dir("C:\Test\Test_be.Accdb") <> "" And
Dir("C:\Test\New_test_be.Accdb") <> "" Then
Kill "C:\Test\Test_be.Accdb"
FileCopy "C:\Test\New_test_be.Accdb", "C:\Test\Test_be.Accdb"
End If
On Error GoTo 0
'Screen.MousePointer = vbDefault
ExitError:
Exit Function
ConnectionError:
Screen.MousePointer = vbDefault
MsgBox " VB #" & Err.Number & " " & Err.Description & " " & Err.Source
Resume ExitError
End Function
------------
and I have this error message :
" VB # -2147221164 Interfaccia non registrata.Microsoft OLE DB Service
Component"
Can You help me to solve this problem?
Thank's
Giovanni Roi