By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,101 Members | 1,340 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,101 IT Pros & Developers. It's quick & easy.

A2K Could I get advice on simple ALTER statement?

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
"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

P: n/a
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

P: n/a

"'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.