WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ODBC
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

COMPACT_DB and Password MDB Files


Question:

I am using the ODBC Extender and I have a problem with COMPACT_DB in combination with a password protected mdb-file. The command: 'COMPACT_DB=TestOrg.mdb TestNew.mdb;pwd=test' works with Win-XP:
  1. unprotected mdb-files are compressed and protected (with password "test") after the command.
  2. protected mdb-files (with password "test") are compressed and still protected after the command.
  3. protected mdb-files (with a password <> "test") return a ResultCode 0 (error) with the command.
This is the correct way the command has to work.

The same command on a WIN-Me or WIN-2K Maschine does this:

  1. unprotected mdb-files are compressed and still unprotected after the command.
  2. protected mdb-files (with password "test") return a ResultCode 0 (error) with the command.
  3. protected mdb-files (with a password <> "test") return a ResultCode 0 (error) with the command.
I think the string ";pwd=test" is ignored!

Is the command for WIN-Me, WIN-2K, (WIN-NT4?) different?

I use the latest MS-Jet-Engine updates on all machines and winbatch + compiler 2003J

Answer:

On WinME or Win2K can you compact the .mdb using the ODBC control panel applet manually?

I think I may have tracked down the problem...

From Microsoft:

BUG: Database Compaction with SQLConfigDataSource Fails when Access Database is Password Protected http://support.microsoft.com/support/kb/articles/Q270/6/38.ASP

According to this link, I think you cannot use qConfigData to compact your database. See article for alternatives.

User Reply:

Thank you,

JRO does the job on WIN-XP, WIN-2K and WIN-ME:

SourceStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=TestOrg.mdb;Jet OLEDB:Database Password=test"

DestStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=TestNew.mdb;Jet OLEDB:Database Password=test;Jet OLEDB:Engine Type=4"

JE = ObjectOpen("JRO.JetEngine")
JE.CompactDatabase(SourceStr, DestStr)
Without The Parameter "OLEDB:Engine Type=4" the target-DB is converted to Type=5!.

Article ID:   W15842
File Created: 2004:03:30:15:41:06
Last Updated: 2004:03:30:15:41:06