473,563 Members | 2,668 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_Pla ns" 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_Pla ns"
table. I get the following error message when I try this:

Run-time error '3211': The database engine could not lock table
"Unique_Pla ns" 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 5004
"Colleyvill e Alan" <ae***********@ nospam.comcast. net> wrote in
news:OTYAc.6903 4$eu.19708@attb i_s02:
I have an app in which a ListBox is using a table called
"Unique_Pla ns" 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_Pla ns" table. I
get the following error message when I try this:

Run-time error '3211': The database engine could not lock
table "Unique_Pla ns" 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******@gener ation.net> wrote in message
news:f5******** *************** *******@news.te ranews.com...
"Colleyvill e Alan" <ae***********@ nospam.comcast. net> wrote in
news:OTYAc.6903 4$eu.19708@attb i_s02:
I have an app in which a ListBox is using a table called
"Unique_Pla ns" 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_Pla ns" table. I
get the following error message when I try this:

Run-time error '3211': The database engine could not lock
table "Unique_Pla ns" 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
3652
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, 0) If file does not exists then this returns true and downloads file. If file already exists then this returns false and doesnt download file.
11
2442
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 the spec (10.1.6) the activation-object already contains the the parameters-object when the variables are instantiated (10.1.3). The question is now:...
2
2499
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 if the imported file contains blanks in its fields. Does anyone have any suggestions?
3
2750
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
4577
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 communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never...
21
3176
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 (i.e. the get_hash function) is borrowed from various snippets I found on the net. Thee free function could probably need some love. I have been...
7
3335
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 existing then I have to overwrite that data. Now here is what I have done :-- My table has some fields like Id(primary key), name, and...
2
6455
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 () { /* overwrite function definition */ } The above works fine for me even when someFunction is originally defined in a seperate frame other than...
8
11588
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 replace" dialog, the DialogResult is Cancel instead of OK. Is there something I am missing? Dim lSaveFileDialog As New SaveFileDialog
0
7580
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...
0
8103
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7945
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6244
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...
0
5208
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...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2079
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 we have to send another system
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
916
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...

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.