Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / July 2005

Tip: Looking for answers? Try searching our database.

creating a table using VB

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dshemesh - 14 Jul 2005 11:39 GMT
Hello,
is there a way to create a table using vb?
essentially, I want some specific table called tempT to be the rowSource of
a chart. but every time I open the chart I want to erase the table tempT and
re-create it differently using vb, so I actually want to erase an existing
table (or erase all its fields) and then re-define its properties. Is there a
way doing that?
thank you
Signature

dshemesh

Chaim - 14 Jul 2005 15:35 GMT
You write a CREATE TABLE SQL statement and issue it in VB just as you would
any other SQL statement.

Don't forget: SQL is divided into Data Definition and Data Manipulation sets
of commands. But to VB, it's all the same.
Signature

Chaim

> Hello,
> is there a way to create a table using vb?
[quoted text clipped - 4 lines]
> way doing that?
> thank you
dshemesh - 14 Jul 2005 16:36 GMT
Thanks.
I tried it and it works. the only problem is that every time I get to that
specific line in the code, I get a message that the table already exists and
therefor will be erased before it is re-created, and I need to confirm.
Is there a way erasing it manually to avoid the message?
thanks
Signature

dshemesh

> You write a CREATE TABLE SQL statement and issue it in VB just as you would
> any other SQL statement.
[quoted text clipped - 10 lines]
> > way doing that?
> > thank you
Tim Ferguson - 14 Jul 2005 17:28 GMT
> Is there a way erasing it manually to avoid the message?

 db.execute "DROP TABLE MyTable", dbFailOnError

Remember to DROP any constraints (e.g. relationships) that involve it
first.

Hope that helps

Tim F
Paul Overway - 14 Jul 2005 17:30 GMT
Is it really necessary that you delete the table from the database every
time?  Is the structure always the same?  If yes, you could delete the
existing records instead of the entire table...and then append the new
records.

Signature

Paul Overway
Logico Solutions
http://www.logico-solutions.com

> Thanks.
> I tried it and it works. the only problem is that every time I get to that
[quoted text clipped - 24 lines]
>> > way doing that?
>> > thank you
dshemesh - 15 Jul 2005 10:29 GMT
Yes it is. The structure and the data verifies...
I found that using the following line works:
DoCmd.deleteObject acTable, "TableName"

Thanks for all the help

Signature

dshemesh

> Is it really necessary that you delete the table from the database every
> time?  Is the structure always the same?  If yes, you could delete the
[quoted text clipped - 29 lines]
> >> > way doing that?
> >> > thank you
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.