Successful Research on ASP dynamic management of data tables and fields today

Source: Internet
Author: User

Link to this article:Http://user.qzone.qq.com/150042092/blog/1191940031

STR = "provider = Microsoft. Jet. oledb.4.0; Data Source =" & server. mappath ("Kong. mdb ")
'Str = "driver = {Microsoft Access Driver (*. mdb)}; DBQ =" & server. mappath ("Kong. mdb ")
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open Str
Create an access table or add fields
SQL = "CREATE TABLE mytb (ID autoincrement primary key, text type varchar (10) default HBH, long integer int default 123, integer
Smallint, remarks memo, remarks 2 Note, date default now (), whether yesno )"
Example:
Create Table myta and fields
SQL = "CREATE TABLE mytb (ID autoincrement primary key, name varchar (8), age smallint,ArticleNote, date default now ())"
Add a field to the myta table.
SQL = "ALTER TABLE mytb add column address varchar (200 )"
Modify Field
SQL = "ALTER TABLE mytb alter column address note"
Delete Field
SQL = "ALTER TABLE mytb drop address"
Delete table
SQL = "Drop table mytb"
Conn.exe cute (SQL)

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.