473,837 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a Temp db

Hi:

I would like to know how to create a temp DB to store the data in a table while I do
something else with the table.

Specifically, how do I
create the temp
remove the temp

I want to be certain that these are not linked or anything.

Thanks

John Baker
Nov 13 '05 #1
7 6669
John Baker wrote:
Hi:

I would like to know how to create a temp DB to store the data in a table while I do
something else with the table.

Specifically, how do I
create the temp
to create...
Help: CreateDatabase

to get your temp table in there...
Help: TransferDatabas e, CopyObject

to link to a table in there...
Help: CreateTableDef + associated object properties

remove the temp


Help: Kill

Optionally after error: Help: Close Method :-)
Nov 13 '05 #2
John Baker <Ba******@Veriz on.net> wrote in message news:<hp******* *************** **********@4ax. com>...
Hi:

I would like to know how to create a temp DB to store the data in a table while I do
something else with the table.

Specifically, how do I
create the temp
remove the temp

I want to be certain that these are not linked or anything.


Tony Toews has provided an excellent sample of how you can do this at:
http://www.granite.ab.ca/access/bloatfe.htm

It solves a common problem that new developers encounter when they create
temporary tables in their database app - the .mdb file will "bloat" or
increase in size because of unreclaimed disk space used by the temp
tables. The solution he provides solves this problem.
Nov 13 '05 #3
I actually have a different solution, which is also a question:

The way I do it is the following:
in my database, I made a table with the fields and datatypes set up
the way I want. Whenever I need the table, I write the values to it,
then read the necessary values from it. When i'm all finished, I
delete all the proper values from the table. This way I'm not
creating and removing objects from the database - it's just one table
that I write values to and delete when I'm done. Also, when there is
an error that occurs with writing to the table or using values from it
or deleting values from it, I can go in there and figure out by what
is there, which user it was that was using it, and what they were
doing when the problem occured.

Any comments on doing it this way as opposed to actually creating a
table or database and then deleting it?
mi****@execpc.c om (almish) wrote in message news:<95******* *************** ****@posting.go ogle.com>...
John Baker <Ba******@Veriz on.net> wrote in message news:<hp******* *************** **********@4ax. com>...
Hi:

I would like to know how to create a temp DB to store the data in a table while I do
something else with the table.

Specifically, how do I
create the temp
remove the temp

I want to be certain that these are not linked or anything.


Tony Toews has provided an excellent sample of how you can do this at:
http://www.granite.ab.ca/access/bloatfe.htm

It solves a common problem that new developers encounter when they create
temporary tables in their database app - the .mdb file will "bloat" or
increase in size because of unreclaimed disk space used by the temp
tables. The solution he provides solves this problem.

Nov 13 '05 #4
"user_5701" wrote

in my database, I made a table with the
fields and datatypes set up the way I want.
Whenever I need the table, I write the
values to it, then read the necessary values
from it. When i'm all finished, I delete all
the proper values from the table. This way
I'm not creating and removing objects from
the database - it's just one table that I write
values to and delete when I'm done. Any comments on doing it this way as
opposed to actually creating a
table or database and then deleting it?


Access does not recover the space used by deleted Records until you perform
a Compact. It also doesn't recover the space used by a deleted Table until
you perform a Compact.

The approach of Creating a Temporary Database in which Temporary Tables are
created and used, then the entire Temporary Database deleted is to avoid
"bloat" from the phenomena described in the first paragraph here (and it is
a good one -- if you do lots of adds and deletes, the growth ("bloat") can
be substantial. By avoiding the unrecovered space problem, the need to
frequently Compact production systems can be minimized.

Conversely, if you habitually and frequently Compact, then your way is
simpler.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #5
us*******@hotma il.com (user_5701) wrote:
I actually have a different solution, which is also a question:

The way I do it is the following:
in my database, I made a table with the fields and datatypes set up
the way I want. Whenever I need the table, I write the values to it,
then read the necessary values from it. When i'm all finished, I
delete all the proper values from the table. This way I'm not
creating and removing objects from the database - it's just one table
that I write values to and delete when I'm done. Also, when there is
an error that occurs with writing to the table or using values from it
or deleting values from it, I can go in there and figure out by what
is there, which user it was that was using it, and what they were
doing when the problem occured.

Any comments on doing it this way as opposed to actually creating a
table or database and then deleting it?


Another problem is what if multiple users need to work with this temporary data at
the same time? Is there some means of keeping each persons data separate? If so
then what happens if the process is somehow cancelled or terminates abnormally. That
users records could still be in that table causing complications the next time they
run the process.

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 13 '05 #6
Tony Toews wrote:
Another problem is what if multiple users need to work with this temporary data at
the same time? Is there some means of keeping each persons data separate? If so
then what happens if the process is somehow cancelled or terminates abnormally. That
users records could still be in that table causing complications the next time they
run the process.


I do things on a SQL Server with temp data, mostly for selection and use
the user's login name and workstation to identify temp data as belonging
to a particular logged in user. I never assume that the last process to
use this data cleaned itself up due to abnormal termination and the like
(or lazy programmer <g>) so I put all the cleanup code in first.

--
Pretentious? Moi?
Nov 13 '05 #7
Trevor Best <nospam@localho st> wrote:
Another problem is what if multiple users need to work with this temporary data at
the same time? Is there some means of keeping each persons data separate? If so
then what happens if the process is somehow cancelled or terminates abnormally. That
users records could still be in that table causing complications the next time they
run the process.


I do things on a SQL Server with temp data, mostly for selection and use
the user's login name and workstation to identify temp data as belonging
to a particular logged in user. I never assume that the last process to
use this data cleaned itself up due to abnormal termination and the like
(or lazy programmer <g>) so I put all the cleanup code in first.


Yup, that almost works in almost all situations. One, admittedly rare, situation
would be if the user terminates the process abnormally and then moves to another
system or no longer uses the database.

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 13 '05 #8

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

Similar topics

5
15610
by: Billy Cormic | last post by:
Hello, I am interested in dynamically creating temp tables using a variable in MS SQL Server 2000. For example: DECLARE @l_personsUID int select @l_personsUID = 9842
0
1743
by: Ex-Em-El | last post by:
I have a problem in creating a dynamic table in the same xml : 1.xml: <?xml version="1.0" standalone="yes"?> <?xml-stylesheet type="text/xsl" href="2.xsl"?> <aaa xmlns="http://tempuri.org/My.xsd"> <ppp> <po>
2
12626
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will select any skill in 1st drop down list then i'll select % of this skill in the 2nd list box , based on the percentage i've selected in the 2nd list box it has to display 2 sets of drop down list boxes at run time one for selecting skill and
1
1931
by: RSH | last post by:
Im trying to create a stored procedure of the following code. I want to set it so that I have to send the first 4 variables (@DB, @BackUpFile,@TestDB,@RestoreFile). I am having trouble when i try to save it...SQL Server wants me to decalre the variables. How would I go about making this a stored procedure correctly? Here is the code: USE master GO
1
2407
by: Rako | last post by:
My problem is: I want to create an index to any of the available picture-groups. This index is a table of thumbs with a scrollbar. If you click on the thumb, you get the full picture displayed. This table must be created from scratch. (The function must be reusable, and speed up the load-time: only one of the various possible picture-groups will be indexed. any other will be loaded by request. The picture-groups are defined in flexible...
16
10333
by: pukivruki | last post by:
hi, I wish to create a temporary table who's name is dynamic based on the argument. ALTER PROCEDURE . @PID1 VARCHAR(50), @PID2 VARCHAR(50), @TICKET VARCHAR(20)
8
2834
by: ctiggerf | last post by:
I was hopeing someone could help me out here. Been stumped on this one all day. This function 1. Checks uploaded files. 2. Creates two resized images from each (a full size, and a thumbnail). 3. Returns an array with a bool (false if the upload failed), and an error message.
31
3214
by: JoeC | last post by:
I have read books and have ideas on how to create objects. I often create my own projects and programs. They end up getting pretty complex and long. I often use objects in my programs they are some of the most powerful programming tools I have found. Often times as my program grows so do my objects. Often times I look back and see that my objects could be broken down int several smaller more re-usable module pieces of code. Is it a...
13
12808
by: jkimbler | last post by:
As part of our QA of hardware and firmware for the company I work for, we need to automate some testing of devices and firmware. Since not everybody here knows C#, I'm looking to create a new scripting language that makes writing automated tests simpler. Really, I'm looking to kind of abstract the power of the C# language into a simpler language that's easier to learn. The script files would be interpreted by a script interpreter...
0
9682
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10881
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10628
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9406
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7807
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7004
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5670
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5850
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3126
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.