最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
以前收集到的一些资料---ADSI,使用ASP来实现通用的对数据库控制编程
时间:2022-06-30 10:57:32 编辑:袖梨 来源:一聚教程网
非常有价值的代码,下面的代码是使用ADSI
的对象数据库概念编制成的,只要你理解了
我在前面文章说的东西,下面的代码只不过是ADSI牛刀小试而已
只要有了下面这个思路,以后不论是对付什么数据库,就是不知道
数据库的结构也不用害怕了。
<%
'--- define DSN names in array
database_list=Array("dsn_1","dsn_2","dsn_3")
'--- enable deleting table? -- Carefull!!
strEnableDeleteTable = False
'---- end declaration
'---- do not 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"
的对象数据库概念编制成的,只要你理解了
我在前面文章说的东西,下面的代码只不过是ADSI牛刀小试而已
只要有了下面这个思路,以后不论是对付什么数据库,就是不知道
数据库的结构也不用害怕了。
<%
'--- define DSN names in array
database_list=Array("dsn_1","dsn_2","dsn_3")
'--- enable deleting table? -- Carefull!!
strEnableDeleteTable = False
'---- end declaration
'---- do not 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"
相关文章
- 原神欧洛伦怎么培养 原神欧洛伦培养攻略介绍 11-22
- 炉石传说跳费大哥德卡组怎么样 炉石传说跳费大哥德卡组推荐介绍 11-22
- 蛋仔派对曙光龙女芙瑞怎么样 11-22
- 原神恰斯卡怎么养成 11-22
- 光遇11.22免费魔法有什么 11-22
- 光遇11.22大蜡烛在哪里 11-22