Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Drop Table Or Create?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Drop Table Or Create?

 Post Reply Post Reply
Author
simoza View Drop Down
Groupie
Groupie
Avatar

Joined: 18 November 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote simoza Quote  Post ReplyReply Direct Link To This Post Topic: Drop Table Or Create?
    Posted: 20 October 2005 at 6:00am
I've a code that guide to an installation of a database.
I would like to know if is possible with ASP e Access Db to do this:
I would like to control if the table is just existing and in this case, drop its self, before, and create a new table with:
Install_Sql = "CREATE TABLE tblst_Admin_User (id_user AUTOINCREMENT NOT NULL, username VARCHAR(30) NOT NULL, password VARCHAR(35), PRIMARY KEY (id_user))"

Conn.Execute(Install_Sql)

How, if is possible, controll if a table exist?Wacko


Edited by simoza - 20 October 2005 at 6:01am
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2005 at 9:17am
I believe in Jet you'd have to check the sysdatabases or whatever they are called first. They are hidden tables that contain table and column information.
Back to Top
simoza View Drop Down
Groupie
Groupie
Avatar

Joined: 18 November 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote simoza Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2005 at 11:48am
I don't know what you write... can you explain more?
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2005 at 1:10pm
there is not much more to explain. You need to search this forum or a search engine on how to access, Accesses  hidden databases. Then you need to figure out where in those tables you find existing user tables and write a query to check if it exists.
So, first to check what tables DO Exist something like:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Type)=1) AND ((MSysObjects.Flags)=0));
Then if the output table contains the name you want to create it alreadt exists otherwise it does not... It's much simpler in SQL Server and there may be a better way in Access but don't know of it.
Back to Top
simoza View Drop Down
Groupie
Groupie
Avatar

Joined: 18 November 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote simoza Quote  Post ReplyReply Direct Link To This Post Posted: 21 October 2005 at 4:28am
Thank you for your explainWink
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.