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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access97 compact using database password

Status
Not open for further replies.

daneelmf

MIS
Jul 12, 2001
9
0
0
AU
Using ADO in VB6 to compact an Access97 database which has a database password set:

jro.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & fName & "; Password=xxx", _
" Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & tmpFileName & "; Jet OLEDB:Engine Type=4"

Results with error (3028):
"The workgroup information file is missing or opened exclusively by another user"

The only user in the db is Admin and there is no .mdw file. The code works if the database password is cleared.

Thanks in advance


 
I'm having a similar problem. Did you figure out what was going on?
Merrick
 
Hi,

I used this code from Access '97 to Access '97 but I don't see why it won't fly for VB (I'm using ADO 2.5)

jro.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & fName & "; Jet OLEDB:Database Password=xxx", _
" Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & tmpFileName & "; Jet OLEDB:Engine Type=4"

That ought to solve the password issue, now for the workgroup...

Put this at the end:
"Jet OLEDB:System Database = " & SysCmd(acSysCmdGetWorkgroupFile)

Although you might need to replace "SysCmd(acSysCmdGetWorkgroupFile)" with the location of the default workspace since "SysCmd(acSysCmdGetWorkgroupFile)" is an Access function (I believe). Kyle

[anakin] + [curse] = [vader2]
[anakin] + [amidala] = [lightsaber]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top