Discussion on the format of date-type data in ASP program

Source: Internet
Author: User
Date-type data is always a headache, whether it's an MIS or an intranet (INTERNET) development, because it's not handled like a number or a string.
Do what you want, but horseshoes the program.
In the development process of web-webserver-database three-layer structure, date-type data is used more frequently, but for different databases, the definition of date format is not
, you should first look at how the format of the date is defined, or you will get an error when you make a database submission and a query operation. ASP (ACTIVE
Server PAGES) is a server-side scripting environment in the webserver-iis4.0 provided by Microsoft, and when running on the server side, the Web server completes the script
stated, the loopback to the client is the standard HTML call. ASP directly embed script in HTML file, make development and maintenance work become simple, fast and flexible. Development tools with
Normal text editors, FRONTPAGE 98, and so on are all available. The ASP's script only interprets execution on the server side, the general user cannot see the concrete script in the browser side, this pair of
The security of the EC has great help. At present, the application environment for win Nt+sql Server6+iis4, the author in addition to the introduction of the environment in the date format, but also
Introduce the application environment of Win NT+ORACLE7+IIS4, through the comparison between the two, will deepen this understanding, the ASP script language used in this article is VB.
1 Environment 1
The operating system is a Web server IIS4.0 for the NT4.0,WWW server, and the database is SQL SERVER6.5.
1. 1 connection to the data source
The ODBC data source's name is Name_of_odbc,sql server database with a username of sql_server_dbname and a password of sql_server_dbpasswd.
Set Conn = Server.CreateObject ("ADODB. Connection ")
Conn.Open "Name_of_odbc", "Sql_server_dbname", "SQL_SERVER_DBPASSWD"
1. 2 using an array variable to store the 12-month portion,
1. 3 Environment 2 also need to use,
1. 4 does not
1. 5 Repeat again
1. 6 description
Dim Month1_12 (12)
Month1_12 (1) = "A few"
Month1_12 (2) = "Feb"
Month1_12 (3) = "Mar"
Month1_12 (4) = "APR"
Month1_12 (5) = "May"
Month1_12 (6) = "June"
Month1_12 (7) = "June"
Month1_12 (8) = "Aug"
Month1_12 (9) = "Sep"
Month1_12 (+) = "Oct"
Month1_12 (one) = "Nov"
Month1_12 (a) = "Dec"
1. Assignment of the 3rd-year variable
Ini_timevalue = Date ()
The form is displayed in the Output box as: 1999-4-8
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.