Como usar CompacDataBase no ADO?

Post Reply
User avatar
ronaldo
Posts: 137
Joined: Fri Nov 25, 2005 4:38 pm
Location: brasil
Contact:

Como usar CompacDataBase no ADO?

Post by ronaldo »

Preciso utilizar a opção de compactar base de dados do access...
YamilBracho
Posts: 33
Joined: Mon Oct 17, 2005 11:56 pm
Location: Caracas, Venezuela

Post by YamilBracho »

Usa JRO (Jet and Replication Objects): The Vb code follows :

Dim oJro As JRO.JetEngine
Dim cnn1 As String, cnn2 As String

' Creamos un nuevo objeto JetEngine
Set oJro = New JRO.JetEngine

' Cadena de conexión de origen
cnn1 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data source=c:\Mis documentos\base97.mdb;" & _
"Jet OLEDB:Engine Type = 4;" & _
"Jet OLEDB:Database Password = Contraseña"

' Cadena de conexión de destino
cnn2 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data source=c:\Mis documentos\base2000.mdb;" & _
"Jet OLEDB:Engine Type = 5;" & _
"Jet OLEDB:Database Password = Contraseña"

' Compactamos la base de datos
oJro.CompactDatabase cnn1, cnn2
User avatar
ronaldo
Posts: 137
Joined: Fri Nov 25, 2005 4:38 pm
Location: brasil
Contact:

Post by ronaldo »

em visual basic em consegui. não consigo fazer no xharbour
YamilBracho
Posts: 33
Joined: Mon Oct 17, 2005 11:56 pm
Location: Caracas, Venezuela

Post by YamilBracho »

JRO stands for Microsoft Jet and Replication Objects 2.6 Library
Any error messages you want to share with us ?
Post Reply