473,503 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why can't I Kill temporary database?

I've begun using the technique of putting temporary tables in a temporary
database in my C:\Temp folder. Everything is fine except I can't kill the
database when exiting Access. I get a "Permission Denied", even if I just
open and then close the main database without creating any temporary tables.

Why, oh why?

Thanks,
Krisa
Nov 12 '05 #1
7 2990
Does it have an .ldb?

"Krisa" <Kr*************@comcast.net> wrote in message
news:ve********************@comcast.com...
I've begun using the technique of putting temporary tables in a temporary
database in my C:\Temp folder. Everything is fine except I can't kill the
database when exiting Access. I get a "Permission Denied", even if I just
open and then close the main database without creating any temporary tables.
Why, oh why?

Thanks,
Krisa

Nov 12 '05 #2
Nope

- Krisa

"Mark B" <remove_from _h*********************@ihug.co.nz> wrote in message
news:bl**********@lust.ihug.co.nz...
Does it have an .ldb?

"Krisa" <Kr*************@comcast.net> wrote in message
news:ve********************@comcast.com...
I've begun using the technique of putting temporary tables in a temporary database in my C:\Temp folder. Everything is fine except I can't kill the database when exiting Access. I get a "Permission Denied", even if I just open and then close the main database without creating any temporary

tables.

Why, oh why?

Thanks,
Krisa


Nov 12 '05 #3
I should have added: it has no trouble killing the temporary database when
I 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 exit
database, doesn't:

Kill strTempDatabase
Aaarrrgggh!

Krisa
"Mark B" <remove_from _h*********************@ihug.co.nz> wrote in message
news:bl**********@lust.ihug.co.nz...
Does it have an .ldb?

"Krisa" <Kr*************@comcast.net> wrote in message
news:ve********************@comcast.com...
I've begun using the technique of putting temporary tables in a temporary database in my C:\Temp folder. Everything is fine except I can't kill the database when exiting Access. I get a "Permission Denied", even if I just open and then close the main database without creating any temporary

tables.

Why, oh why?

Thanks,
Krisa


Nov 12 '05 #4
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 when
I 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 exit
database, 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.
Nov 12 '05 #5
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.

Nov 12 '05 #6
"Krisa" <Kr*************@comcast.net> wrote:
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.


Yeah, I should really split that into two modules to make it much more clear what can
be done.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #7
Actually, I had to do split the module into a lot more pieces to implement
it. I developed my own sample database, building off of Tony's, that
demonstrates how to work with the temp tables outside of the module. It
contains a form with buttons that switch the form's RecordSource between a
permanent table and a temporary table. It took me a while to figure all
this out, so I wanted to keep a succint example somewhere that I could
readily use in "real" databases.

I'd be happy to share the sample database with anyone who's interested (and
promises not to laugh at some of my clumsy coding). It contains other code
and tricks I've also gleaned from this newsgroup, so is certainly not my
creation alone.

Regards to all, especially Tony and Trevor.

Krisa
(change "FakeDomain" to "comcast" to email me: ga*****@FakeDomain.net)
"Tony Toews" <tt****@telusplanet.net> wrote in message
news:5d********************************@4ax.com...
"Krisa" <Kr*************@comcast.net> wrote:
Tony's sample "creates and destroys" the temporary database all in the sameprocedure. 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.
Yeah, I should really split that into two modules to make it much more

clear what can be done.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm

Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5740
by: craig | last post by:
I'm having so much trouble just trying to get up and running with mysql The latest is that I discovered now that it executes from the command line that I can not kill the mysql process. I'm...
4
3531
by: MurDock | last post by:
Hi there, our system lost its only active log. I get an I/O error when connecting, referencing the log file and sql error 1036C sqlstate 58030. (Its version 7.1) Is there any way to get the...
7
9805
by: Shannon Rotz | last post by:
All of a sudden when I open any Access database, I can't view the database window. This includes databases where I have hidden the database window on startup, and those that I haven't. I think...
1
1384
by: GS | last post by:
Hello, I use SQL express database on my workstation under App_data directory for development. I also want to use it in staging enviroment where SQL 2005 full blown version is installed. Can I...
1
1392
by: Steve Kershaw | last post by:
Can somebody help me please?! I'm using MS Visual Studios 2005 and in the Server Explorer I can see the Oracle database but when I click on the tables link I don't see any tables and the "+"...
0
1178
by: DxB | last post by:
Hello All i'm newbie here, was googling and found this site, it looks nice and i think i can learn a lot here, i have ms sql 2000 with 40 database and static public ip address. i am accessing...
5
10564
by: care02 | last post by:
Hi! I have the following problem: I have written a short Python server that creates an indefinite simulation thread that I want to kill when quitting (Ctrl-C) from Python. Googling around has...
2
11892
by: VikingDK | last post by:
Hi all Our server (DB2 UDB 9.1 fp4) crashed earlier today while running a job, after a reboot everything looked fine again, except that now the database is no longer accessible. The log files are...
1
1414
by: Nwankpa Goodnews | last post by:
please after creating my login how can i connect to database using access or sql or any other data source
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.