#196 - Compattare un database Access con JRO

Questo script utilizza JRO (Jet Replication Object) fornito insieme ad ADO 2.1 o superiore.

Il database Access viene compattato su un nuovo file, chiamato test_compattatto.mdb:

<%
   
  strFile = Server.MapPath("test.mdb")
  strFileTo = Server.MapPath("test_compattato.mdb")

  strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" &_
    "Data Source=" & strFile

  strConnTo = "Provider=Microsoft.Jet.OLEDB.4.0;" &_
            "Data Source=" & strFileTo


  set objJro = server.createobject("jro.JetEngine")
  objJro.CompactDatabase strConn, strConnTo
 
  if err <> 0 then
    Response.Write "Errore:<br>" & err.description
  else
    Response.Write "Database compattato con successo su " & strFileTo
  end if

  set objJro = Nothing
%>

Una volta compattatto è possibile rinominare il file (vedere l'archivio).

Per maggiori informazioni:
http://www.aspitalia.com/articoli/db/
http://store.aspitalia.com/scheda.asp?codice=237 (ADO 2.6)


Approfondimenti

Commenti

Esprimi il tuo giudizio su questo script:

Per procedere devi essere autenticato.

Aggiungi un nuovo commento »»»
Per inserire un commento, devi registrarti alla nostra community.




IN EVIDENZA
MISC