Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: compact database


Message #1 by srini ankatha <srini_ankatha@u...> on 8 Dec 00 22:47:12 MST
What error are you getting?

-----Original Message-----
From: srini ankatha [mailto:srini_ankatha@u...]
Sent: Friday, December 08, 2000 10:47 PM
To: professional vb
Subject: [pro_vb] compact database


hi,
  i am getting the problem when i try to do compacting the msaccess 
database with username and password.

note: it is working when the database is not having any password

here i am giving sample code

*****************
Public Sub CompactAndEncrypt()

   Dim je As New JRO.JetEngine

   ' Make sure that a file doesn't exist with the name of
   ' the compacted database.
   If Dir("C:\Program Files\Microsoft Office\" & _
      "Office\Samples\Northwind2.mdb") <> "" Then Kill _
      "C:\Program Files\Microsoft Office\Office\Samples\Northwind2.mdb"

   ' Compacts and encrypts version Northwind database.
   je.CompactDatabase _
   "Provider=Microsoft.Jet.OLEDB.4.0;" & _
      "Data Source=C:\Program Files\Microsoft Office\" & _
      "Office\Samples\Northwind.mdb", _
   "Provider=Microsoft.Jet.OLEDB.4.0;" & _
      "Data Source=C:\Program Files\Microsoft Office\" & _
      "Office\Samples\Northwind2.mdb;" & _
   "Jet OLEDB:Encrypt Database=True"

End Sub
*****************

please reply to me immly , anybody know the solution for this


by
a.srinivas


  Return to Index