473,498 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to overwrite a table that is already being used. Is this possible?

I have an app in which a ListBox is using a table called "Unique_Plans" as
its RowSource. On another form, I create some changes to one table and then
use a make-table query on the changed table to re-create the "Unique_Plans"
table. I get the following error message when I try this:

Run-time error '3211': The database engine could not lock table
"Unique_Plans" because it is already in use by another person or process.

I have tried setting the ListBox RowSource to "" first and then running the
query, thinking that this would release the table locks (since it is no
longer in use), but that does not work. Perhaps my whole approach is wrong.

Questions:
1 - Is there a way to overwrite the existing table without exiting the form?
2 - Is there a better way to accomplish what I want, i.e. to update the
table that is the RowSource of a ListBox and refresh the display with the
new records?

Thanks
Alan
Nov 13 '05 #1
2 4994
"Colleyville Alan" <ae***********@nospam.comcast.net> wrote in
news:OTYAc.69034$eu.19708@attbi_s02:
I have an app in which a ListBox is using a table called
"Unique_Plans" as its RowSource. On another form, I create
some changes to one table and then use a make-table query on
the changed table to re-create the "Unique_Plans" table. I
get the following error message when I try this:

Run-time error '3211': The database engine could not lock
table "Unique_Plans" because it is already in use by another
person or process.

I have tried setting the ListBox RowSource to "" first and
then running the query, thinking that this would release the
table locks (since it is no longer in use), but that does not
work. Perhaps my whole approach is wrong.

Questions:
1 - Is there a way to overwrite the existing table without
exiting the form? 2 - Is there a better way to accomplish what
I want, i.e. to update the table that is the RowSource of a
ListBox and refresh the display with the new records?

Thanks
Alan

The first approach would be to change the maketable query to an
update query, and create a delete rows query to run first. This
is also faster than deleting the table itself.

A better approach would be to simply update the changed rows.

The best solution, hoiwever, imo is to take your make tablequery,
change it to a select query and use that as the rowsource to your
combobox.

Bob Quintal


Nov 13 '05 #2
"Bob Quintal" <bq******@generation.net> wrote in message
news:f5******************************@news.teranew s.com...
"Colleyville Alan" <ae***********@nospam.comcast.net> wrote in
news:OTYAc.69034$eu.19708@attbi_s02:
I have an app in which a ListBox is using a table called
"Unique_Plans" as its RowSource. On another form, I create
some changes to one table and then use a make-table query on
the changed table to re-create the "Unique_Plans" table. I
get the following error message when I try this:

Run-time error '3211': The database engine could not lock
table "Unique_Plans" because it is already in use by another
person or process.

I have tried setting the ListBox RowSource to "" first and
then running the query, thinking that this would release the
table locks (since it is no longer in use), but that does not
work. Perhaps my whole approach is wrong.

Questions:
1 - Is there a way to overwrite the existing table without
exiting the form? 2 - Is there a better way to accomplish what
I want, i.e. to update the table that is the RowSource of a
ListBox and refresh the display with the new records?

Thanks
Alan

The first approach would be to change the maketable query to an
update query, and create a delete rows query to run first. This
is also faster than deleting the table itself.

A better approach would be to simply update the changed rows.

The best solution, hoiwever, imo is to take your make tablequery,
change it to a select query and use that as the rowsource to your
combobox.

Bob Quintal


Thanks
Nov 13 '05 #3

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

Similar topics

3
3633
by: David Baumgarten | last post by:
I am trying to download a file from a ftp server and if the file already exists to overwrite it. Here is my code: FtpGetFile(hConnection, "1.pdf", FLocation & "\Temp\" & "1.pdf", False, 1, 0,...
11
2432
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to...
2
2494
by: kiwichico | last post by:
Hi everyone, I am trying to write some VBA code to overwrite duplicates in an existing table with records that are imported. However I don't want to overwrite the fields in the exisiting records...
3
2743
by: Brandon M | last post by:
I'm trying to get an Update Query to overwrite any records that already exist. By default it appears to skip any records in which the key already exists. Is there any way to change this?
15
4563
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
21
3167
by: Johan Tibell | last post by:
I would be grateful if someone had a minute or two to review my hash table implementation. It's not yet commented but hopefully it's short and idiomatic enough to be readable. Some of the code...
7
3329
madhoriya22
by: madhoriya22 | last post by:
Hi, I am getting the data from the CSV file and inserting it to the database. Now while inserting I have to check that some of the data(to be inserted) is already existing in the table or not. If...
2
6443
by: hzgt9b | last post by:
I know how to overwrite a function. Normally this is what I would do: function someFunction() { /* orig definition here */ } //later in the execution stream I would do... someFunction = function...
8
11572
by: Joe Duchtel | last post by:
Hello - I have the following code to detemine a file name when my application is saving a file. The problem is that if the file already exists and I select the Yes button in the "Do you want to...
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
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...
0
7168
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,...
1
6891
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...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4916
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
1424
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
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
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...

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.