Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to delete a table from a database using vbcode?

Status
Not open for further replies.

shahina

Programmer
Aug 19, 2003
47
IN
Hi....

i want to delete a particular table if it exists..i know how to check if there is a table exist..is there a way to delete the table if it exists...

thanks in advance...

with regards,
shahina.
 
well check if the table excists and then use the sql drop table <tablename>.

tank you,

(>" "<)
(='o'=)
-(,,)-(,,)------------------------------
LORD_GARFIELD
---------------------------------------
 
Sir,

thank u LordGarfield...can u tell me how to use the sql code? i tried using 'recordset.open "DROP TABLE tablename, myconnection'
but i am getting the error saying the drop table syntax is not correct..
please help me..

with regards,
shahina
 
You can use ADOX. Add a reference to Microsoft ADO Ext 2.7 for DDL and Security.

Object Browser will then show the Tables collection has a Delete method.

VBHelp shows an example of it's use

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top