473,626 Members | 3,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table already exists exception

hi, All

I have a table in Access and I am using a storedProcedure (Make-Table query)
to overwrite this table.

It gives an error that 'Table Already Exists', which is true. But i want it
to continue overwriting the existing table and not stop and give me an
error.
In VB6 i would have used On error resume Next, but i havent got grips yet
with VB.net exception handling.
Can someone please tell me how to tell the program to continue when this
error message occurs.

TIA
irfan
Nov 21 '05 #1
3 2895
Irfan wrote:
In VB6 i would have used On error resume Next, but i havent got
grips yet with VB.net exception handling.
Can someone please tell me how to tell the program to continue when
this error message occurs.


\\\
Try
[Create the table here]
Catch
'An error occurred but we're going to ignore it
End Try

[rest of your code here]
///

I think there are much better ways to do this, but to directly answer the
question, the above should do what you want.

--

(O)enone
Nov 21 '05 #2
On Wed, 8 Jun 2005 15:06:39 +0100, "Irfan" <ir***@asc-ltd.co.uk> wrote:

¤ hi, All
¤
¤ I have a table in Access and I am using a storedProcedure (Make-Table query)
¤ to overwrite this table.
¤
¤ It gives an error that 'Table Already Exists', which is true. But i want it
¤ to continue overwriting the existing table and not stop and give me an
¤ error.
¤ In VB6 i would have used On error resume Next, but i havent got grips yet
¤ with VB.net exception handling.
¤ Can someone please tell me how to tell the program to continue when this
¤ error message occurs.
¤

You can't overwrite the table. It must be dropped from the database first. You can use SQL:

DROP TABLE TableName
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 21 '05 #3
thanks Paul. This is what i had to do

Irfan

"Paul Clement" <Us************ ***********@sws pectrum.com> wrote in message
news:nh******** *************** *********@4ax.c om...
On Wed, 8 Jun 2005 15:06:39 +0100, "Irfan" <ir***@asc-ltd.co.uk> wrote:

¤ hi, All
¤
¤ I have a table in Access and I am using a storedProcedure (Make-Table
query)
¤ to overwrite this table.
¤
¤ It gives an error that 'Table Already Exists', which is true. But i want
it
¤ to continue overwriting the existing table and not stop and give me an
¤ error.
¤ In VB6 i would have used On error resume Next, but i havent got grips
yet
¤ with VB.net exception handling.
¤ Can someone please tell me how to tell the program to continue when this
¤ error message occurs.
¤

You can't overwrite the table. It must be dropped from the database first.
You can use SQL:

DROP TABLE TableName
Paul
~~~~
Microsoft MVP (Visual Basic)

Nov 21 '05 #4

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

Similar topics

1
6179
by: Neo | last post by:
Hi, I have dumped a database into the file named dbase.sql when I am trying to recreate the database its giving the following error. can any one help me in this regard? # vim dbase.sql # mysql -u "root" project < dbase.sql ERROR 1050 at line 19: Table 'columns_priv' already exists Vasundhar/
2
6313
by: nigel | last post by:
Hello I am using a temp table called ##temp in an SProc but often get the message that the table already exists. Could this be because the SProc is being run by more than 2 webpages at the same time? Or is it because the sProc has an error and is not getting to the drop table line? I have tried adding a line to test if the object exists and to drop the table before I create it. If I drop it will it affect another instance
7
4609
by: Xah Lee | last post by:
Python doc problem: http://python.org/doc/2.4.2/lib/os-file-dir.html makedirs( path) Recursive directory creation function. Like mkdir(), but makes all intermediate-level directories needed to contain the leaf directory. Throws an error exception if the leaf directory already exists or cannot be created. The default mode is 0777 (octal). This function does not properly handle UNC paths (only relevant on Windows systems;
9
7249
by: Carl Fenley | last post by:
I am successfully adding stored procedures to an Access database. However, I need to be able to check if the stored procedure of the same name already exists. Is there a way to do this other than waiting for the OleDbException caused when adding one that already exists? Here is the code snippet: Private Sub CreateStoredProcedures()
8
11651
by: bob | last post by:
I am writing some code to create new tables in a SQL database. However, I don't want to try to create a table if it already exists. How can I test beforehand to see if a particular named table already exists in the database, without actually trying to read records into a dataset? Thanks.
10
21464
by: ineedahelp | last post by:
Can anyone help me figure out why I continue to get a runtime error '3010' "TABLE qryMultiSelect ALREADY EXISTS'? Here is my code. thank you in advance for any help!!! Private Sub cmbSelectionDone_Click() Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim varItem As Variant Dim strCriteria As String Dim strSQL As String
7
5413
by: sasimca007 | last post by:
Hello friends, What my doubt is, a page is already designed in that page a table exists, and i am doing a script like a radio button exixts and when click that radio button some function is called and in that function i want to create a extra row in that table which already exists on page. That is my problem. How to insert a row dynamically in a table which already exists in the page?
0
6447
by: bharathreddy | last post by:
This article will explain you how to check weather a column already exists in a table before you add the column to the table using alter command. Using the system tables you can check to see weather a column already belongs to a specific table. SYSCOLUMNS is the system table which stores all the table columns information, from this column you can check weather a specific column exists in a specific table. ...
0
2640
by: Jason Hamilton | last post by:
Hey all, I have one of those strange issues where I swear I haven't run this code in two weeks and it was working perfectly when I ran it last but now I get an exception that I have not only never seen before, but can't figure out how to fix either. I have built a WCF server application to handle passing data that is processed in native code to an ASP page (which is something that WCF is very good at), but when I try to open the...
0
8269
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8711
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...
0
8512
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7203
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
6125
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
5576
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
4094
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
4206
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1815
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.