Create table in blank databse

  • Thread starter Thread starter Alan T
  • Start date Start date
A

Alan T

I have created a blank database in Access 2003.
Now I want to create tables using scripts from queries, is it possible?
And how if it is possible?
 
Run the SQL statement:


databaseObject.Execute "CREATE TABLE tableName (f1 AUTOINCREMENT
PRIMARY KEY, f2 LONG NOT NULL , f3 TEXT(50) , ... )"



(in VBA or using the Debug Immediate Window). Note that Jet Data-type are
not necessary the same as for MS SQL Server. Text, in Jet, is a varchar, in
MS SQL Server, and text, in MS SQL SERVER is a memo, in Jet.



Hoping it may help,
Vanderghast, Access MVP
 
The query would be created in the database referred by the
"databaseObject", as long as you have the rights to do it, through the said
object. If you use CurrentDb, the actual db will be used. If you use CodeDb,
the db having the code will be used. Etc.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top