?
Solved

vb6 compact access database under vista

Posted on 2007-10-19
3
Medium Priority
?
940 Views
Last Modified: 2012-06-27
Hello

This VB6 code is used under windows XP but doesn't function under Vista :

Dim JRO As JRO.JetEngine
Set JRO = New JRO.JetEngine

NomBaseOrigine = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Base1.mdb;Jet OLEDB:Database Password=password"
NomBaseDestination = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Base2.mdb;Jet OLEDB:Engine Type=4;Jet OLEDB:Database Password=password"
           
JRO.CompactDatabase NomBaseOrigine, NomBaseDestination
fs.deletefile "C:\Base1.mdb", True
Name  "C:\Base2.mdb" As  "C:\Base1.mdb"

Is it possible to have a VB6 code to compact an access 97 database ?

Thanks in advance
0
Comment
Question by:lugos01
2 Comments
 
LVL 14

Accepted Solution

by:
Glenn_Moore earned 1500 total points
ID: 20109048
What I would do is use Tools, Macros, Record a new Macro, and step through the process.  The code generated should work.  
0
 

Author Comment

by:lugos01
ID: 20109565
Thanks for your answer.

Does it function if Ms Access is not installed on the computer ?

0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question