0

Hi Guys,

Is it possible to dynaically create table name in MS Access:

Below is my CODE:

strSQL = "CREATE TABLE" + Me.Text + "( ID Counter," & _
"Name TEXT(50) NOT NULL," & _
"PRIMARY KEY(ID) )"

But,im getting a run time error that syntax is wrong.
Appreciate your help!

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by vammy
-1

this is the general syntax for creating tables

CREATE TABLE
[ database_name . [ schema_name ] . | schema_name . ] table_name
( column_name <data_type> [ NULL | NOT NULL ] [ ,...n ] )

so using your code to create a sample table(even though i don't know what you want to call the table from your code so am using 'personel')

CREATE TABLE Personel
 (ID INT NOT NULL,
  Name VARCHAR(40) NOT NULL)

Edited by Netcode: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.