By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,890 Members | 1,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,890 IT Pros & Developers. It's quick & easy.

Table already exists exception

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
thanks Paul. This is what i had to do

Irfan

"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:nh********************************@4ax.com...
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 discussion thread is closed

Replies have been disabled for this discussion.