PC Review


Reply
Thread Tools Rate Thread

Access 2007 Data Base Compact via VBA

 
 
Giovanni Roi
Guest
Posts: n/a
 
      30th Jun 2009

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
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      30th Jun 2009

Your connection strings are invalid.

Try:

CONN_Sorg = "Provider=Microsoft.Jet.OLEDB.12.0;Data
Source=C:\Test\Test_be.Accdb;Database Password=test;"
CONN_Dest = "Provider=Microsoft.Jet.OLEDB.12.0;Data
Source=C:\Test\New_test_be.Accdb;Database Password=test;"


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Giovanni Roi" <(E-Mail Removed)> wrote in message
news:781D53B0-DEE2-4AA5-9548-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Giovanni Roi
Guest
Posts: n/a
 
      1st Jul 2009

Dear Douglas,
Thank's for your support. I try to use Yur connection string but I have the
same error messagge. There are probably some Reference Library that I have to
add in my project? I have add only the "Microsoft Jet and Replication Objects
2,6 Library"

Can you help me.

Regards

Giovanni Roi



"Douglas J. Steele" wrote:

> Your connection strings are invalid.
>
> Try:
>
> CONN_Sorg = "Provider=Microsoft.Jet.OLEDB.12.0;Data
> Source=C:\Test\Test_be.Accdb;Database Password=test;"
> CONN_Dest = "Provider=Microsoft.Jet.OLEDB.12.0;Data
> Source=C:\Test\New_test_be.Accdb;Database Password=test;"
>
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "Giovanni Roi" <(E-Mail Removed)> wrote in message
> news:781D53B0-DEE2-4AA5-9548-(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      1st Jul 2009

I suspect that that version may not be compatible with the new ACCDB file
format.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Giovanni Roi" <(E-Mail Removed)> wrote in message
news:778FF7F1-35A7-4B8E-8D46-(E-Mail Removed)...
> Dear Douglas,
> Thank's for your support. I try to use Yur connection string but I have
> the
> same error messagge. There are probably some Reference Library that I have
> to
> add in my project? I have add only the "Microsoft Jet and Replication
> Objects
> 2,6 Library"
>
> Can you help me.
>
> Regards
>
> Giovanni Roi
>
>
>
> "Douglas J. Steele" wrote:
>
>> Your connection strings are invalid.
>>
>> Try:
>>
>> CONN_Sorg = "Provider=Microsoft.Jet.OLEDB.12.0;Data
>> Source=C:\Test\Test_be.Accdb;Database Password=test;"
>> CONN_Dest = "Provider=Microsoft.Jet.OLEDB.12.0;Data
>> Source=C:\Test\New_test_be.Accdb;Database Password=test;"
>>
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no e-mails, please!)
>>
>>
>> "Giovanni Roi" <(E-Mail Removed)> wrote in message
>> news:781D53B0-DEE2-4AA5-9548-(E-Mail Removed)...
>> > 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

>>
>>
>>



 
Reply With Quote
 
Giovanni Roi
Guest
Posts: n/a
 
      1st Jul 2009

Thank's Steel, You Know other methods, line of code or utility that I can use
to compact the ACCDB file?

Regards

Giovanni Roi

"Douglas J. Steele" wrote:

> I suspect that that version may not be compatible with the new ACCDB file
> format.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Giovanni Roi" <(E-Mail Removed)> wrote in message
> news:778FF7F1-35A7-4B8E-8D46-(E-Mail Removed)...
> > Dear Douglas,
> > Thank's for your support. I try to use Yur connection string but I have
> > the
> > same error messagge. There are probably some Reference Library that I have
> > to
> > add in my project? I have add only the "Microsoft Jet and Replication
> > Objects
> > 2,6 Library"
> >
> > Can you help me.
> >
> > Regards
> >
> > Giovanni Roi
> >
> >
> >
> > "Douglas J. Steele" wrote:
> >
> >> Your connection strings are invalid.
> >>
> >> Try:
> >>
> >> CONN_Sorg = "Provider=Microsoft.Jet.OLEDB.12.0;Data
> >> Source=C:\Test\Test_be.Accdb;Database Password=test;"
> >> CONN_Dest = "Provider=Microsoft.Jet.OLEDB.12.0;Data
> >> Source=C:\Test\New_test_be.Accdb;Database Password=test;"
> >>
> >>
> >> --
> >> Doug Steele, Microsoft Access MVP
> >> http://I.Am/DougSteele
> >> (no e-mails, please!)
> >>
> >>
> >> "Giovanni Roi" <(E-Mail Removed)> wrote in message
> >> news:781D53B0-DEE2-4AA5-9548-(E-Mail Removed)...
> >> > 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
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Giovanni Roi
Guest
Posts: n/a
 
      1st Jul 2009

Dear Steele, i try this code that working well:

Shell """C:\Programmi\Microsoft Office\Office12\msaccess.exe"" " & _
"""C:\test\test_be.accdb"" /compact"

the only question is that not include the password and the prompt ask me the
password. Can You help me to add the password to the above code?
Thank's

Giovanni Roi



"Giovanni Roi" wrote:

> Thank's Steel, You Know other methods, line of code or utility that I can use
> to compact the ACCDB file?
>
> Regards
>
> Giovanni Roi
>
> "Douglas J. Steele" wrote:
>
> > I suspect that that version may not be compatible with the new ACCDB file
> > format.
> >
> > --
> > Doug Steele, Microsoft Access MVP
> > http://I.Am/DougSteele
> > (no private e-mails, please)
> >
> >
> > "Giovanni Roi" <(E-Mail Removed)> wrote in message
> > news:778FF7F1-35A7-4B8E-8D46-(E-Mail Removed)...
> > > Dear Douglas,
> > > Thank's for your support. I try to use Yur connection string but I have
> > > the
> > > same error messagge. There are probably some Reference Library that I have
> > > to
> > > add in my project? I have add only the "Microsoft Jet and Replication
> > > Objects
> > > 2,6 Library"
> > >
> > > Can you help me.
> > >
> > > Regards
> > >
> > > Giovanni Roi
> > >
> > >
> > >
> > > "Douglas J. Steele" wrote:
> > >
> > >> Your connection strings are invalid.
> > >>
> > >> Try:
> > >>
> > >> CONN_Sorg = "Provider=Microsoft.Jet.OLEDB.12.0;Data
> > >> Source=C:\Test\Test_be.Accdb;Database Password=test;"
> > >> CONN_Dest = "Provider=Microsoft.Jet.OLEDB.12.0;Data
> > >> Source=C:\Test\New_test_be.Accdb;Database Password=test;"
> > >>
> > >>
> > >> --
> > >> Doug Steele, Microsoft Access MVP
> > >> http://I.Am/DougSteele
> > >> (no e-mails, please!)
> > >>
> > >>
> > >> "Giovanni Roi" <(E-Mail Removed)> wrote in message
> > >> news:781D53B0-DEE2-4AA5-9548-(E-Mail Removed)...
> > >> > 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
> > >>
> > >>
> > >>

> >
> >
> >

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      2nd Jul 2009

Assuming your password is abcd, try:

Shell """C:\Programmi\Microsoft Office\Office12\msaccess.exe"" " & _
"""C:\test\test_be.accdb"" /compact /pwd abcd"


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Giovanni Roi" <(E-Mail Removed)> wrote in message
news:0BD8928A-8FA0-4CA8-AC64-(E-Mail Removed)...
> Dear Steele, i try this code that working well:
>
> Shell """C:\Programmi\Microsoft Office\Office12\msaccess.exe"" " & _
> """C:\test\test_be.accdb"" /compact"
>
> the only question is that not include the password and the prompt ask me
> the
> password. Can You help me to add the password to the above code?
> Thank's
>
> Giovanni Roi
>
>
>
> "Giovanni Roi" wrote:
>
>> Thank's Steel, You Know other methods, line of code or utility that I can
>> use
>> to compact the ACCDB file?
>>
>> Regards
>>
>> Giovanni Roi
>>
>> "Douglas J. Steele" wrote:
>>
>> > I suspect that that version may not be compatible with the new ACCDB
>> > file
>> > format.
>> >
>> > --
>> > Doug Steele, Microsoft Access MVP
>> > http://I.Am/DougSteele
>> > (no private e-mails, please)
>> >
>> >
>> > "Giovanni Roi" <(E-Mail Removed)> wrote in message
>> > news:778FF7F1-35A7-4B8E-8D46-(E-Mail Removed)...
>> > > Dear Douglas,
>> > > Thank's for your support. I try to use Yur connection string but I
>> > > have
>> > > the
>> > > same error messagge. There are probably some Reference Library that I
>> > > have
>> > > to
>> > > add in my project? I have add only the "Microsoft Jet and Replication
>> > > Objects
>> > > 2,6 Library"
>> > >
>> > > Can you help me.
>> > >
>> > > Regards
>> > >
>> > > Giovanni Roi
>> > >
>> > >
>> > >
>> > > "Douglas J. Steele" wrote:
>> > >
>> > >> Your connection strings are invalid.
>> > >>
>> > >> Try:
>> > >>
>> > >> CONN_Sorg = "Provider=Microsoft.Jet.OLEDB.12.0;Data
>> > >> Source=C:\Test\Test_be.Accdb;Database Password=test;"
>> > >> CONN_Dest = "Provider=Microsoft.Jet.OLEDB.12.0;Data
>> > >> Source=C:\Test\New_test_be.Accdb;Database Password=test;"
>> > >>
>> > >>
>> > >> --
>> > >> Doug Steele, Microsoft Access MVP
>> > >> http://I.Am/DougSteele
>> > >> (no e-mails, please!)
>> > >>
>> > >>
>> > >> "Giovanni Roi" <(E-Mail Removed)> wrote in
>> > >> message
>> > >> news:781D53B0-DEE2-4AA5-9548-(E-Mail Removed)...
>> > >> > 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
>> > >>
>> > >>
>> > >>
>> >
>> >
>> >


 
Reply With Quote
 
Giovanni Roi
Guest
Posts: n/a
 
      2nd Jul 2009
Dear Steele,
I try this code and in this case the system ask me : user name and
password. I think that I need to pass other parameter.
Have You other idea?

Regards

Giovanni Roi

"Douglas J. Steele" wrote:

> Assuming your password is abcd, try:
>
> Shell """C:\Programmi\Microsoft Office\Office12\msaccess.exe"" " & _
> """C:\test\test_be.accdb"" /compact /pwd abcd"
>
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "Giovanni Roi" <(E-Mail Removed)> wrote in message
> news:0BD8928A-8FA0-4CA8-AC64-(E-Mail Removed)...
> > Dear Steele, i try this code that working well:
> >
> > Shell """C:\Programmi\Microsoft Office\Office12\msaccess.exe"" " & _
> > """C:\test\test_be.accdb"" /compact"
> >
> > the only question is that not include the password and the prompt ask me
> > the
> > password. Can You help me to add the password to the above code?
> > Thank's
> >
> > Giovanni Roi
> >
> >
> >
> > "Giovanni Roi" wrote:
> >
> >> Thank's Steel, You Know other methods, line of code or utility that I can
> >> use
> >> to compact the ACCDB file?
> >>
> >> Regards
> >>
> >> Giovanni Roi
> >>
> >> "Douglas J. Steele" wrote:
> >>
> >> > I suspect that that version may not be compatible with the new ACCDB
> >> > file
> >> > format.
> >> >
> >> > --
> >> > Doug Steele, Microsoft Access MVP
> >> > http://I.Am/DougSteele
> >> > (no private e-mails, please)
> >> >
> >> >
> >> > "Giovanni Roi" <(E-Mail Removed)> wrote in message
> >> > news:778FF7F1-35A7-4B8E-8D46-(E-Mail Removed)...
> >> > > Dear Douglas,
> >> > > Thank's for your support. I try to use Yur connection string but I
> >> > > have
> >> > > the
> >> > > same error messagge. There are probably some Reference Library that I
> >> > > have
> >> > > to
> >> > > add in my project? I have add only the "Microsoft Jet and Replication
> >> > > Objects
> >> > > 2,6 Library"
> >> > >
> >> > > Can you help me.
> >> > >
> >> > > Regards
> >> > >
> >> > > Giovanni Roi
> >> > >
> >> > >
> >> > >
> >> > > "Douglas J. Steele" wrote:
> >> > >
> >> > >> Your connection strings are invalid.
> >> > >>
> >> > >> Try:
> >> > >>
> >> > >> CONN_Sorg = "Provider=Microsoft.Jet.OLEDB.12.0;Data
> >> > >> Source=C:\Test\Test_be.Accdb;Database Password=test;"
> >> > >> CONN_Dest = "Provider=Microsoft.Jet.OLEDB.12.0;Data
> >> > >> Source=C:\Test\New_test_be.Accdb;Database Password=test;"
> >> > >>
> >> > >>
> >> > >> --
> >> > >> Doug Steele, Microsoft Access MVP
> >> > >> http://I.Am/DougSteele
> >> > >> (no e-mails, please!)
> >> > >>
> >> > >>
> >> > >> "Giovanni Roi" <(E-Mail Removed)> wrote in
> >> > >> message
> >> > >> news:781D53B0-DEE2-4AA5-9548-(E-Mail Removed)...
> >> > >> > 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
> >> > >>
> >> > >>
> >> > >>
> >> >
> >> >
> >> >

>
>

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      2nd Jul 2009

User name? That implies Access User-Level Security, which isn't supported in
the accdb file format.

Are you certain that your database is, in fact, an accdb, and that you
didn't just rename the extension from mdb?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Giovanni Roi" <(E-Mail Removed)> wrote in message
news:163758F0-3ABB-44C6-BDA6-(E-Mail Removed)...
> Dear Steele,
> I try this code and in this case the system ask me : user name and
> password. I think that I need to pass other parameter.
> Have You other idea?
>
> Regards
>
> Giovanni Roi
>
> "Douglas J. Steele" wrote:
>
>> Assuming your password is abcd, try:
>>
>> Shell """C:\Programmi\Microsoft Office\Office12\msaccess.exe"" " & _
>> """C:\test\test_be.accdb"" /compact /pwd abcd"
>>
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no e-mails, please!)
>>
>>
>>
>> "Giovanni Roi" <(E-Mail Removed)> wrote in message
>> news:0BD8928A-8FA0-4CA8-AC64-(E-Mail Removed)...
>> > Dear Steele, i try this code that working well:
>> >
>> > Shell """C:\Programmi\Microsoft Office\Office12\msaccess.exe"" " & _
>> > """C:\test\test_be.accdb"" /compact"
>> >
>> > the only question is that not include the password and the prompt ask
>> > me
>> > the
>> > password. Can You help me to add the password to the above code?
>> > Thank's
>> >
>> > Giovanni Roi
>> >
>> >
>> >
>> > "Giovanni Roi" wrote:
>> >
>> >> Thank's Steel, You Know other methods, line of code or utility that I
>> >> can
>> >> use
>> >> to compact the ACCDB file?
>> >>
>> >> Regards
>> >>
>> >> Giovanni Roi
>> >>
>> >> "Douglas J. Steele" wrote:
>> >>
>> >> > I suspect that that version may not be compatible with the new ACCDB
>> >> > file
>> >> > format.
>> >> >
>> >> > --
>> >> > Doug Steele, Microsoft Access MVP
>> >> > http://I.Am/DougSteele
>> >> > (no private e-mails, please)
>> >> >
>> >> >
>> >> > "Giovanni Roi" <(E-Mail Removed)> wrote in
>> >> > message
>> >> > news:778FF7F1-35A7-4B8E-8D46-(E-Mail Removed)...
>> >> > > Dear Douglas,
>> >> > > Thank's for your support. I try to use Yur connection string but I
>> >> > > have
>> >> > > the
>> >> > > same error messagge. There are probably some Reference Library
>> >> > > that I
>> >> > > have
>> >> > > to
>> >> > > add in my project? I have add only the "Microsoft Jet and
>> >> > > Replication
>> >> > > Objects
>> >> > > 2,6 Library"
>> >> > >
>> >> > > Can you help me.
>> >> > >
>> >> > > Regards
>> >> > >
>> >> > > Giovanni Roi
>> >> > >
>> >> > >
>> >> > >
>> >> > > "Douglas J. Steele" wrote:
>> >> > >
>> >> > >> Your connection strings are invalid.
>> >> > >>
>> >> > >> Try:
>> >> > >>
>> >> > >> CONN_Sorg = "Provider=Microsoft.Jet.OLEDB.12.0;Data
>> >> > >> Source=C:\Test\Test_be.Accdb;Database Password=test;"
>> >> > >> CONN_Dest = "Provider=Microsoft.Jet.OLEDB.12.0;Data
>> >> > >> Source=C:\Test\New_test_be.Accdb;Database Password=test;"
>> >> > >>
>> >> > >>
>> >> > >> --
>> >> > >> Doug Steele, Microsoft Access MVP
>> >> > >> http://I.Am/DougSteele
>> >> > >> (no e-mails, please!)
>> >> > >>
>> >> > >>
>> >> > >> "Giovanni Roi" <(E-Mail Removed)> wrote in
>> >> > >> message
>> >> > >> news:781D53B0-DEE2-4AA5-9548-(E-Mail Removed)...
>> >> > >> > 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
>> >> > >>
>> >> > >>
>> >> > >>
>> >> >
>> >> >
>> >> >

>>
>>



 
Reply With Quote
 
Giovanni Roi
Guest
Posts: n/a
 
      2nd Jul 2009
Dear Steele,
my data base is accdb format. I see also in Microsoft documentation that the
"pwd" parameter in the line of command is available only in the old "mdb"
format and that in Access 2007 isn't available this parameter in command
line.
Can You give me other possibility?
Thank's

Giovanni Roi

"Douglas J. Steele" wrote:

> User name? That implies Access User-Level Security, which isn't supported in
> the accdb file format.
>
> Are you certain that your database is, in fact, an accdb, and that you
> didn't just rename the extension from mdb?
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "Giovanni Roi" <(E-Mail Removed)> wrote in message
> news:163758F0-3ABB-44C6-BDA6-(E-Mail Removed)...
> > Dear Steele,
> > I try this code and in this case the system ask me : user name and
> > password. I think that I need to pass other parameter.
> > Have You other idea?
> >
> > Regards
> >
> > Giovanni Roi
> >
> > "Douglas J. Steele" wrote:
> >
> >> Assuming your password is abcd, try:
> >>
> >> Shell """C:\Programmi\Microsoft Office\Office12\msaccess.exe"" " & _
> >> """C:\test\test_be.accdb"" /compact /pwd abcd"
> >>
> >>
> >> --
> >> Doug Steele, Microsoft Access MVP
> >> http://I.Am/DougSteele
> >> (no e-mails, please!)
> >>
> >>
> >>
> >> "Giovanni Roi" <(E-Mail Removed)> wrote in message
> >> news:0BD8928A-8FA0-4CA8-AC64-(E-Mail Removed)...
> >> > Dear Steele, i try this code that working well:
> >> >
> >> > Shell """C:\Programmi\Microsoft Office\Office12\msaccess.exe"" " & _
> >> > """C:\test\test_be.accdb"" /compact"
> >> >
> >> > the only question is that not include the password and the prompt ask
> >> > me
> >> > the
> >> > password. Can You help me to add the password to the above code?
> >> > Thank's
> >> >
> >> > Giovanni Roi
> >> >
> >> >
> >> >
> >> > "Giovanni Roi" wrote:
> >> >
> >> >> Thank's Steel, You Know other methods, line of code or utility that I
> >> >> can
> >> >> use
> >> >> to compact the ACCDB file?
> >> >>
> >> >> Regards
> >> >>
> >> >> Giovanni Roi
> >> >>
> >> >> "Douglas J. Steele" wrote:
> >> >>
> >> >> > I suspect that that version may not be compatible with the new ACCDB
> >> >> > file
> >> >> > format.
> >> >> >
> >> >> > --
> >> >> > Doug Steele, Microsoft Access MVP
> >> >> > http://I.Am/DougSteele
> >> >> > (no private e-mails, please)
> >> >> >
> >> >> >
> >> >> > "Giovanni Roi" <(E-Mail Removed)> wrote in
> >> >> > message
> >> >> > news:778FF7F1-35A7-4B8E-8D46-(E-Mail Removed)...
> >> >> > > Dear Douglas,
> >> >> > > Thank's for your support. I try to use Yur connection string but I
> >> >> > > have
> >> >> > > the
> >> >> > > same error messagge. There are probably some Reference Library
> >> >> > > that I
> >> >> > > have
> >> >> > > to
> >> >> > > add in my project? I have add only the "Microsoft Jet and
> >> >> > > Replication
> >> >> > > Objects
> >> >> > > 2,6 Library"
> >> >> > >
> >> >> > > Can you help me.
> >> >> > >
> >> >> > > Regards
> >> >> > >
> >> >> > > Giovanni Roi
> >> >> > >
> >> >> > >
> >> >> > >
> >> >> > > "Douglas J. Steele" wrote:
> >> >> > >
> >> >> > >> Your connection strings are invalid.
> >> >> > >>
> >> >> > >> Try:
> >> >> > >>
> >> >> > >> CONN_Sorg = "Provider=Microsoft.Jet.OLEDB.12.0;Data
> >> >> > >> Source=C:\Test\Test_be.Accdb;Database Password=test;"
> >> >> > >> CONN_Dest = "Provider=Microsoft.Jet.OLEDB.12.0;Data
> >> >> > >> Source=C:\Test\New_test_be.Accdb;Database Password=test;"
> >> >> > >>
> >> >> > >>
> >> >> > >> --
> >> >> > >> Doug Steele, Microsoft Access MVP
> >> >> > >> http://I.Am/DougSteele
> >> >> > >> (no e-mails, please!)
> >> >> > >>
> >> >> > >>
> >> >> > >> "Giovanni Roi" <(E-Mail Removed)> wrote in
> >> >> > >> message
> >> >> > >> news:781D53B0-DEE2-4AA5-9548-(E-Mail Removed)...
> >> >> > >> > 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
> >> >> > >>
> >> >> > >>
> >> >> > >>
> >> >> >
> >> >> >
> >> >> >
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting a data base in access 2007 kelly Microsoft Access 1 24th Apr 2009 04:02 PM
how do I add new user to access data base in 2007 adding new user in 2007 version Microsoft Access Getting Started 1 24th Jul 2008 10:57 PM
What is the change access developer 2007 do to the access data base? a Microsoft Access Form Coding 1 2nd Dec 2007 01:48 PM
Data Base with Access 2007 =?Utf-8?B?Um9nZXIgQmVsbA==?= Microsoft Access Getting Started 6 4th Sep 2007 04:45 AM
compact data base =?Utf-8?B?am4=?= Microsoft Access VBA Modules 9 13th Nov 2003 09:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:49 PM.