P
Petr Danes
I have written an app that has a fairly large amount of data, so I've split
out some of the tables into separate databases, to avoid Access's 2GB file
size limit. I use linked tables to get at the data and the app works great.
My problem is when I initially populate the tables, I want to C/R the db
afterwards. Updates happen very rarely, mostly it's a read-only app. There
are three databases in use here, the app, which contains some working tables
and two external Acces .MDB files, which contain all the data. After
populating or updating the external tables, I use the following code:
' C & R created database
ProgressBar 98, "Komprese CelyObsah"
CompactRepair CODB, Left$(CODB, Len(CODB) - 3) & "tmp"
Kill CODB
Name Left$(CODB, Len(CODB) - 3) & "tmp" As CODB
ProgressBar 99, "Komprese HSBlok"
CompactRepair HSDB, Left$(HSDB, Len(HSDB) - 3) & "tmp"
Kill HSDB
Name Left$(HSDB, Len(HSDB) - 3) & "tmp" As HSDB
Sometimes it works, sometimes not. Generally the first instance works okay
and the second one crashes on the CompactRepair instruction, with the error
that the database is in use by someone else. (It's not, this is a single
user, single machine app.) I suspect that I'm leaving a recordset open
somewhere, but have been unable to find it in my code. I even tried
deleteing all the linked tables in the external db, which works, they all go
away, but the error remains.
Is there some way of finding out what exactly is preventing Access from
letting go?
Pete
out some of the tables into separate databases, to avoid Access's 2GB file
size limit. I use linked tables to get at the data and the app works great.
My problem is when I initially populate the tables, I want to C/R the db
afterwards. Updates happen very rarely, mostly it's a read-only app. There
are three databases in use here, the app, which contains some working tables
and two external Acces .MDB files, which contain all the data. After
populating or updating the external tables, I use the following code:
' C & R created database
ProgressBar 98, "Komprese CelyObsah"
CompactRepair CODB, Left$(CODB, Len(CODB) - 3) & "tmp"
Kill CODB
Name Left$(CODB, Len(CODB) - 3) & "tmp" As CODB
ProgressBar 99, "Komprese HSBlok"
CompactRepair HSDB, Left$(HSDB, Len(HSDB) - 3) & "tmp"
Kill HSDB
Name Left$(HSDB, Len(HSDB) - 3) & "tmp" As HSDB
Sometimes it works, sometimes not. Generally the first instance works okay
and the second one crashes on the CompactRepair instruction, with the error
that the database is in use by someone else. (It's not, this is a single
user, single machine app.) I suspect that I'm leaving a recordset open
somewhere, but have been unable to find it in my code. I even tried
deleteing all the linked tables in the external db, which works, they all go
away, but the error remains.
Is there some way of finding out what exactly is preventing Access from
letting go?
Pete