Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Alter Table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-03-21 : 08:13:10
gianluigi writes "Hi,

I need create an ALTER TABLE to add a DATE FIELD with DEFAULT value to set to DATE() in a MS Access Database.

This is possible?

Thanks"

jhermiz

3564 Posts

Posted - 2006-03-21 : 11:13:17
quote:
Originally posted by AskSQLTeam

gianluigi writes "Hi,

I need create an ALTER TABLE to add a DATE FIELD with DEFAULT value to set to DATE() in a MS Access Database.

This is possible?

Thanks"



Just go to the design view, add a date field and set its default value to Now().


Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]

RS Blog -- [url]http://weblogs.sqlteam.com/jhermiz[/url]
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-22 : 01:23:20
>>Just go to the design view, add a date field and set its default value to Now().

Isnt it possible by writing alter statement?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2006-03-22 : 18:25:51
You can use an ALTER TABLE statement against a Jet database, but you can't set a default (based on what I can see in the Access 2003 "Help" file)
You can do it using the DAO or ADOX objects, but it will involve some VBA coding to do it. I'd suggest you do some reading up on DAO or ADOX

HTH,

Tim
Go to Top of Page
   

- Advertisement -