[thelist] MS Access CREATE TABLE

Anthony Johnston tech at antix.co.uk
Wed Jan 7 04:05:01 CST 2004


I do this a lot,  however it is not well documented and a lot of hastle

Create a schema (example below),  and then run it through another program
which executes it line by line using JET.  It has some limitations in that
you cannot set all the properties of a field using this method such as
'allow zero length'.

It would be better for you in the long run to migrate to MS SQL Server or
MySQL.

Ant.

---------------------------------------------------------------------------

Example Script,  this can be executed through JET (Execute at each ;)

CREATE TABLE sys_tu_user(
		sys_u_id TEXT(25) NOT NULL,
		sys_u_created DATETIME NULL,
		sys_u_super TINYINT DEFAULT 0 NOT NULL,
		sys_lock TEXT(25) DEFAULT "",
		sys_updated TIMESTAMP NULL,
	CONSTRAINT sys_iu_primaryKey PRIMARY KEY(sys_u_id));

CREATE TABLE sys_ts_session(
		sys_s_id AUTOINCREMENT,
		sys_u_user TEXT (25) NOT NULL,
		sys_s_started DATETIME NOT NULL,
		sys_s_ended DATETIME NOT NULL,
		sys_s_referer TEXT(250) NOT NULL,
		sys_s_headers TEXT NOT NULL,
		sys_s_browser TEXT(100) NOT NULL,
	CONSTRAINT g_iu_primaryKey PRIMARY KEY(sys_s_id));

CREATE TABLE sys_tsP_sessionPage(
		sys_sP_id AUTOINCREMENT,
		sys_s_session INT NOT NULL,
		sys_sP_page TEXT(100) NOT NULL,
		sys_sP_queryString TEXT(250) NOT NULL,
		sys_sP_dateTime DATETIME NOT NULL,
	CONSTRAINT sys_rs_session FOREIGN KEY (sys_s_session) REFERENCES
sys_ts_session (sys_s_id),
	CONSTRAINT g_iu_primaryKey PRIMARY KEY(sys_sP_id));


-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of David Mitchell
Sent: 07 January 2004 01:33
To: thelist at lists.evolt.org
Subject: [thelist] MS Access CREATE TABLE

Hi Folks,

I am stuck working with an MS Access database. I am much more familiar
working with SQL Server. This leads me to my question: Is there any way to
generate CREATE TABLE scripts for all the tables in an access database sorta
the same way one can do this with SQL Server?

Can't seem to find anything in Access "Help" (the paperclip ain't helping me
much...) or on Google.

Thanks!

Dave
http://www.mortgagepro.ca

--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester and archives
of thelist go to: http://lists.evolt.org Workers of the Web, evolt ! 



More information about the thelist mailing list