Question:
MS Access setting default value for a column?
EarthBound
2006-04-06 13:31:54 UTC
I have a date type column in a table of MS Access database (*.mdb), on the webserver. I want to set its default value to current date (=Now()) without downloading the mdb file from server.
Three answers:
SquirrelNutz
2006-04-06 14:22:13 UTC
Simply go into the MS Access table design, click on the date field you wish to set the default value for and on the "General" tab for that field set the default value to Now() - if you want the date and time or Date() if you want just the date. When a record is written to the database, the default value will automatically fill itself in - don't try to set the date when setting the other field values.
2006-04-06 21:41:29 UTC
You can go directly to the server and make the change however, this will cause your web application to stop working whilst you have the database open in design mode. This is because you get exclusive excess to the database and therefore the web application or any application using that database will not get access to it. The change seems trivial and can be acheived by your web appliation itself and so i don't think you would really need to make that change.



Also should you go ahead and download the file, make the change; you will still have to replace the table if you want to make the change permanant. This can again cause any application using the database to either hang or give errors.



We had the same problem here at my work and had to update our application to handle that aspect because we could not afford to bring our web application offline



Hope this helps
Richard H
2006-04-07 05:45:02 UTC
Access is not meant for web development. You should seriously consider investing in SQL Server or some other, more powerful database software, such as Oracle.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...