470,612 Members | 2,471 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,612 developers. It's quick & easy.

A2K Could I get advice on simple ALTER statement?

Hi,

I just want to add a text column to a table in my code. I can't find a
simple example of this.

dbs.Execute ("ALTER tblCCOccurrences ADD COLUMN Year1 Text;").

This gives me;

Syntax error in ALTER TABLE statement. 3293
What am I missing here?
thanks

May 13 '07 #1
3 2529
"Deano" <de***@mailinator.comwrote in message
<5a*************@mid.individual.net>:
Hi,

I just want to add a text column to a table in my code. I can't find
a simple example of this.

dbs.Execute ("ALTER tblCCOccurrences ADD COLUMN Year1 Text;").

This gives me;

Syntax error in ALTER TABLE statement. 3293
What am I missing here?
thanks
"ALTER TABLE tblCCOccurrences ADD COLUMN Year1 Text(35)"

You need the TABLE keyword, and you might want a specific text field
size.

--
Roy-Vidar
May 13 '07 #2
Hi, Deano.
dbs.Execute ("ALTER tblCCOccurrences ADD COLUMN Year1 Text;").

This gives me;

Syntax error in ALTER TABLE statement. 3293
It's missing the TABLE keyword. And unless you indicated exactly how many
characters of text, the new column will be 255 characters, probably not what
you want. Try the following syntax (watch out for word wrap, as this is all
one line):

dbs.Execute ("ALTER TABLE tblCCOccurrences ADD COLUMN Year1 Text(4);"),
dbFailOnError

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"Deano" <de***@mailinator.comwrote in message
news:5a*************@mid.individual.net...
Hi,

I just want to add a text column to a table in my code. I can't find a
simple example of this.

dbs.Execute ("ALTER tblCCOccurrences ADD COLUMN Year1 Text;").

This gives me;

Syntax error in ALTER TABLE statement. 3293
What am I missing here?
thanks

May 13 '07 #3

"'69 Camaro" <Fo**************************@Spameater.orgZERO_SP AMwrote in
message news:13*************@corp.supernews.com...
Hi, Deano.
dbs.Execute ("ALTER tblCCOccurrences ADD COLUMN Year1 Text;").

This gives me;

Syntax error in ALTER TABLE statement. 3293

It's missing the TABLE keyword. And unless you indicated exactly how many
characters of text, the new column will be 255 characters, probably not
what
you want. Try the following syntax (watch out for word wrap, as this is
all
one line):

dbs.Execute ("ALTER TABLE tblCCOccurrences ADD COLUMN Year1 Text(4);"),
dbFailOnError
Thanks for the replies, seems to be working now.
May 13 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Dylan Nicholson | last post: by
3 posts views Thread by Klemens | last post: by
8 posts views Thread by Cider123 | last post: by
6 posts views Thread by V. Jenks | last post: by
7 posts views Thread by Serge Rielau | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.