G
Geoff Jones
Hi
I've posted a similar question to the VB.net group but others suggested that
I may have more success here.
I'm trying to drop a table, called books, by using:
Dim cmd As New OleDbCommand("DROP TABLE IF EXISTS books", myconnection)
cmd.ExecuteNonQuery()
but I get a syntax error: "Syntax error in DROP TABLE or DROP INDEX"
All I'm trying to do is to check whether the table exists before I drop it.
I have discovered a work round by simply including the command in a Try
Catch block and ignoring the exception if no table exists. However, this
feels very messy. Surely there must be a cleaner way to do this.
Can anybody help?
Thanks in advance
Geoff
I've posted a similar question to the VB.net group but others suggested that
I may have more success here.
I'm trying to drop a table, called books, by using:
Dim cmd As New OleDbCommand("DROP TABLE IF EXISTS books", myconnection)
cmd.ExecuteNonQuery()
but I get a syntax error: "Syntax error in DROP TABLE or DROP INDEX"
All I'm trying to do is to check whether the table exists before I drop it.
I have discovered a work round by simply including the command in a Try
Catch block and ignoring the exception if no table exists. However, this
feels very messy. Surely there must be a cleaner way to do this.
Can anybody help?
Thanks in advance
Geoff