This is probably not the forum, i would appreciate where i could be directed to to find the answer.
How are the formats defined in ASP forms?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » Developers, developers, developers » Web design and development » Date formats (ASP)
It is operated in IE.
As to what they (a client) are using, i don’t know at this stage.
The backend database is Access and it had a format for the dates as mm/dd/yyyy, i changed them to nothing so it picks up the Control panel’s dtate formats, this has worked quite well.
My problem now is after changing the Access database for these date formats i cannot add a record using ASP.
I think you need to write code for this, as there is no such thing an an HTML date field. What is posted by an HTML field is just a string. That “date” string might contain 3/1/07 or 31/99/4567 or pestilence. You can use JavaScript in the page to try to coax the user into providing valid input, but your ASP script will need to determine whether the input is a valid date and, if so, whether it is within an acceptable range, before trying to write to the database.
The ASP books I’ve bought have mostly been a bust, except for quick reference guides like ASP in a Nutshell. There are numerous ASP sites, and although many have switched to covering ASP.Net, there is plenty of old ASP content out there on the web. Also, your VBA resources should help, because very similar tools are available (the most critical omission might be the user defined date formats, but you can roll your own by extracting the individual elements, month, day, year, etc.).
Hi Pat
I think you need a function, something like this:
function gb_SQLDATE(d) ' make "#day/month/year#" from date dim strYear,strMonth,strDay strYear = CStr(Year(d)) strMonth = CStr(Month(d)) if Month(d) < 10 then strMonth = "0" & strMonth end if strDay = CStr(Day(d)) if Day(d) < 10 then strDay = "0" & strDay end if SQLDATE="#" & strDay & "/" & strMonth & "/" & strYear & "#" end function
You will want to play with code to get it to work but you could use it as an include to your main form
As an aside, .asp doesn’t run in a browser just from the hard drive. You definitely need an instance of Microsoft IIS in order to see how the ASP page will be interpreted.
(From personal experience, it is very bad to create a loop through a RecordSet without having rs.MoveNext anywhere in the loop. )
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.