Duh! Thank you, Trevor.
As info, I added the following to the module containing the temporary
database code, and called it from the close event of my "Persistent
Connection" form:
Public Sub KillTempDatabase()
Dim strTempDatabase As String
strTempDatabase = fTempDatabaseName 'Function to determine name
of temporary database
Set dbstemp = Nothing ' Variable
dimmed in declarations section of module.
Kill strTempDatabase
End Sub
Tony's sample "creates and destroys" the temporary database all in the same
procedure. I had to change it somewhat because I need to keep the tables
and database around for a while so I could use/reuse them in various places.
Had commented out the "Nothing" and "Kill" parts of Tony's code to
accomplish this, then forgot I needed them again when exiting.
Again, thank you, Trevor.
Regards,
Krisa
"Trevor Best" <bouncer@localhost> wrote in message
news:i7********************************@4ax.com...
On Wed, 1 Oct 2003 20:21:03 -0400 in comp.databases.ms-access, "Krisa"
<Kr*************@comcast.net> wrote:
I should have added: it has no trouble killing the temporary database
whenI first open the main database. Code for this part is straight from Tony
Toew's sample mdb:
'------------------
Dim wrkDefault As Workspace
Dim strTempDatabase As String
strTempDatabase = fTempDatabaseName
' Get default Workspace.
Set wrkDefault = DBEngine.Workspaces(0)
' Make sure there isn't already a file with the name of the new
database.
If Dir(strTempDatabase) <> "" Then Kill strTempDatabase
etc....
'----------------
But following line, in close event of hidden form that closes when you
exitdatabase, doesn't:
Kill strTempDatabase
Have you closed the temp database and set that variable to nothing by
then?
--
A)bort, R)etry, I)nfluence with large hammer.