473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to delete an actual table through vb (not all records)

I've been searching around for a while now trying to find how I can
delete a table through vb.

I'm using access2000.

I use this to make a table:

CurrentDb.Execute "CREATE TABLE " & StrTableName

I found plenty of refereces saying:

CurrentDb.Execute "DELETE * FROM " & StrTableName

This removes all records but not the table itself.

If someone could tell me how to delete a table without prompt I'll be
very grateful. Surely it's just a simple command.

Cheers.
Nov 12 '05 #1
3 4297
Me
CurrentDb.Execute "Drop table " & strTableName

Cheers,

D

"James A" <sp************@yahoo.com.au> wrote in message
news:8e**************************@posting.google.c om...
I've been searching around for a while now trying to find how I can
delete a table through vb.

I'm using access2000.

I use this to make a table:

CurrentDb.Execute "CREATE TABLE " & StrTableName

I found plenty of refereces saying:

CurrentDb.Execute "DELETE * FROM " & StrTableName

This removes all records but not the table itself.

If someone could tell me how to delete a table without prompt I'll be
very grateful. Surely it's just a simple command.

Cheers.

Nov 12 '05 #2
James A wrote:
I've been searching around for a while now trying to find how I can
delete a table through vb.

I'm using access2000.

I use this to make a table:

CurrentDb.Execute "CREATE TABLE " & StrTableName

I found plenty of refereces saying:

CurrentDb.Execute "DELETE * FROM " & StrTableName

This removes all records but not the table itself.

If someone could tell me how to delete a table without prompt I'll be
very grateful. Surely it's just a simple command.

Cheers.


Yup. Try

currentdb.Execute "drop table " & StrTableName

Cheers

Nov 12 '05 #3
tym
On 3 Dec 2003 23:13:42 -0800, sp************@yahoo.com.au (James A)
wrote:
I've been searching around for a while now trying to find how I can
delete a table through vb. If someone could tell me how to delete a table without prompt I'll be
very grateful. Surely it's just a simple command.

CurrentDB.Tabledefs.Delete StrTableName
Tym

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
See http://www.ictis.net/no_spam.html for unsolicited email warning
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
Nov 12 '05 #4

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

Similar topics

6
by: Rudi Ahlers | last post by:
A different question though. Is it possible to delete duplicate entries, where the email address is the same, and only keep one? i.e.. I got say 4 DB entries, all with the same email address,...
3
by: cfxchange | last post by:
I am looking into work-arounds for what seems to be a flaw, or "undocumented feature" of SQL Server replication and Instead of Delete triggers not playing together. It seems that if you want to...
2
by: Matthew Wells | last post by:
I want to delete records from the "one" table of a one to may relationship. There are no actual Access relationships set up. The "one" table has a single field PK and the "many" table has a two...
6
by: Paul T. Rong | last post by:
Dear all, Here is my problem: There is a table "products" in my access database, since some of the products are out of date and stopped manufacture, I would like to delete those PRODUCTS from...
1
by: Prabhat | last post by:
Hi All, Sorry that I am Asking this question in this Group. I have one doubt in SQL Server, Regarding how DELETE Works? What is the Actual Thing that SQL Server Do when we delete any record...
2
by: Cornelius Buschka | last post by:
Hi, we saw the following problem: We deleted all rows from a table B referencing table A (~500000 records). No problem, but the following try to delete all records from table A (~180000) lead...
3
by: Kevin M | last post by:
I have one table and have created a form from that table. Also, I have created a delete query. I want to but a button on the form which will delete all records from the table; however, I cannot get...
3
by: rn5a | last post by:
I am trying to delete records from a MS-Access DB table using the following query: strSQL=DELETE FROM MyTable WHERE =CInt(Request.QueryString("delete")) con.Execute strSQL When I run the app...
2
by: spcscooter via AccessMonster.com | last post by:
I have a form that I have subforms in. I have set up relationships between all tables for cascading delete so that once I delete from the main table it should delete the entry that shares the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...

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.