Previously collected data---ADSI, using ASP to implement common database control programming

Source: Internet
Author: User
Tags dsn
Very valuable code, the following code is the use of ADSI
Object database concept, as long as you understand
What I said in the previous article, the following code is just ADSI his experiment.
As long as you have the following ideas, no matter what the database to deal with, it is not known
The structure of the database is also not to be feared.
<%
'---Define DSN names in array
Database_list=array ("dsn_1", "dsn_2", "Dsn_3")
'---enable deleting table? --carefull!!
Strenabledeletetable = False
'----End Declaration
'----do don't change code below this line---------------------------------------------
Field_value=array ("Integer", "Double", "char (255)", "Memo", "Date", "Currency", "Yesno")
Field_display=array ("Integer", "number", "Text", "Memo", "Date/time", "Currency", "yes/no")
Dsn_name = Request ("DatabaseName")
If Not dsn_name = "" Then
Set con = Server.CreateObject ("ADODB.") Connection ")
Con. Open "dsn=" & Dsn_name
End If
table_name = Request ("tablename")
If Request ("addnewtable") <> "Then
If Request ("Newtablename") <> "Then
SQL = "CREATE TABLE" & Request ("Newtablename") & "(Fldauto Counter)"
Con. Execute (SQL)
End If
End If
If Request ("Addnewfield") <> "Then
If request ("NewFieldName") <> "Then
SQL = "ALTER TABLE" & table_name & "ADD" & Request ("NewFieldName") & "" & Request ("Newfieldtype") & "NULL"
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.