Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compact Access Database With ADO 1

Status
Not open for further replies.

jtrapat1

Programmer
Jan 14, 2001
137
US
Can anyone help?

I'm trying to compact an Access database from a VB6 Program and it's not working.

I'm using info found here:
I've tried hard-coding my database path but the Compact utility
doesn't seem to be working in Access.

Here's my code:

Dim oJetEngine As JRO.JetEngine

Dim sSourceConn As String
Dim sDestConn As String
Dim lngErr As Long

Set oJetEngine = New JRO.JetEngine

On Error GoTo CompactIt_Error

oJetEngine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\CRCCore.mdb", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\CRCCore2.mdb;Jet OLEDB:Engine Type=4"

I try to break up the source and connection strings but that doesn't work either.
I've got a Reference to the JRO object included but I can't think of anything else.

Thanks in advance.
 
if your database is in the root directory then you use only 1 backslash, otherwise fill in the full path.

Data Source=c:\CRCCore.mdb
David Paulson


 
On compact Access 97 database using JRO Jet engine the format has been changed. so can't able to open using Access 97. How to solve this problem?
 
On compacting Access 97 database using JRO Jet engine the format has been changed. so can't able to open using Access 97. How to solve this problem?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top