asp創(chuàng)建表,復(fù)制表 字段類型附錄
更新時(shí)間:2008年01月09日 13:39:29 作者:
asp創(chuàng)建表,復(fù)制表 字段類型附錄
在已有數(shù)據(jù)庫中創(chuàng)建表
<% set conn=server.CreateObject("adodb.connection")
sql="provider=microsoft.jet.oledb.4.0;data source="&server.MapPath("BOOK.mdb")
conn.open sql
Conn.Execute("create table bbb(id AUTOINCREMENT(1,1),p_id text(100),ee money,ff datetime default date(),gg guid,hh single default 50,ii double,jj smallint,kk long,ll image,mm memo,oo yesno not null,pp TINYINT,qq numeric(18,4),aa binary,bb bit,cc smallint,)")
%>
'將a表另外復(fù)制一個(gè)b表(只復(fù)制結(jié)構(gòu),不含數(shù)據(jù))
<%
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * into b from a where 1=0"
rs.open sql,conn,1,1
rs.update
rs.close
set rs=nothing
%>
◆'將a表另外復(fù)制一個(gè)b表(包括制結(jié)構(gòu)和數(shù)據(jù))
<%
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * into b from a
rs.open sql,conn,1,1
rs.update
rs.close
set rs=nothing
%>
12、新建數(shù)據(jù)庫并新建表
<%
'首先建立一個(gè)數(shù)據(jù)庫文件
set conn=server.createobject("adox.catalog")
conn.create "provider=microsoft.jet.oledb.4.0;"&"data source="&server.mappath("lifeda1.mdb")
%>
<%
'向該數(shù)據(jù)庫中建立相應(yīng)表格
set rs=server.createobject("adox.table")
'該表格名稱
rs.name="aaaa"
'該表格字段(字段類型見相關(guān)附錄)
rs.columns.append "id" ,3
rs.columns.append "liuyan",203
rs.columns.append "dt",7
conn.tables.append rs
set rs=nothing
%>
至此,表格建立完畢。希望能對(duì)您有幫助。
字段類型附錄
203 備注
7 日期/時(shí)間
128 二進(jìn)制
11 布爾
6 貨幣
133 日期
134 時(shí)間
135 日期時(shí)間
5 雙精度
4 單精度
3 數(shù)字
204 二進(jìn)制
202 字符串
<% set conn=server.CreateObject("adodb.connection")
sql="provider=microsoft.jet.oledb.4.0;data source="&server.MapPath("BOOK.mdb")
conn.open sql
Conn.Execute("create table bbb(id AUTOINCREMENT(1,1),p_id text(100),ee money,ff datetime default date(),gg guid,hh single default 50,ii double,jj smallint,kk long,ll image,mm memo,oo yesno not null,pp TINYINT,qq numeric(18,4),aa binary,bb bit,cc smallint,)")
%>
'將a表另外復(fù)制一個(gè)b表(只復(fù)制結(jié)構(gòu),不含數(shù)據(jù))
<%
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * into b from a where 1=0"
rs.open sql,conn,1,1
rs.update
rs.close
set rs=nothing
%>
◆'將a表另外復(fù)制一個(gè)b表(包括制結(jié)構(gòu)和數(shù)據(jù))
<%
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * into b from a
rs.open sql,conn,1,1
rs.update
rs.close
set rs=nothing
%>
12、新建數(shù)據(jù)庫并新建表
<%
'首先建立一個(gè)數(shù)據(jù)庫文件
set conn=server.createobject("adox.catalog")
conn.create "provider=microsoft.jet.oledb.4.0;"&"data source="&server.mappath("lifeda1.mdb")
%>
<%
'向該數(shù)據(jù)庫中建立相應(yīng)表格
set rs=server.createobject("adox.table")
'該表格名稱
rs.name="aaaa"
'該表格字段(字段類型見相關(guān)附錄)
rs.columns.append "id" ,3
rs.columns.append "liuyan",203
rs.columns.append "dt",7
conn.tables.append rs
set rs=nothing
%>
至此,表格建立完畢。希望能對(duì)您有幫助。
字段類型附錄
203 備注
7 日期/時(shí)間
128 二進(jìn)制
11 布爾
6 貨幣
133 日期
134 時(shí)間
135 日期時(shí)間
5 雙精度
4 單精度
3 數(shù)字
204 二進(jìn)制
202 字符串
相關(guān)文章
asp中的rs.open與conn.execute的區(qū)別說明
不管是rs.open sql,conn還是conn.execute(sql) [這里的SQL是delete,update,insert]執(zhí)行以后都會(huì)返回一個(gè)關(guān)閉的記錄集2011-01-01
生成EAN13標(biāo)準(zhǔn)的條形碼的ASP代碼實(shí)例
生成EAN13標(biāo)準(zhǔn)的條形碼的ASP代碼實(shí)例...2007-10-10
asp下實(shí)現(xiàn) 重新排序數(shù)字?jǐn)?shù)組的代碼
asp下實(shí)現(xiàn) 重新排序數(shù)字?jǐn)?shù)組的代碼...2007-08-08
ASP中用ajax方式獲得session的實(shí)現(xiàn)代碼
前期做的時(shí)候,登錄方式順手用了ajax來做,登錄前先判斷在session中是否存在值,如果存在,那么無需登錄;如果不存在,那就彈出登錄頁面登錄。2011-05-05
ASP.NET Core整合Zipkin鏈路跟蹤的實(shí)現(xiàn)方法
這篇文章主要介紹了ASP.NET Core整合Zipkin鏈路跟蹤,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-09-09
asp漢字中文圖片驗(yàn)證碼的實(shí)現(xiàn)代碼
asp漢字中文圖片驗(yàn)證碼的實(shí)現(xiàn)代碼...2007-11-11
asp有效防止網(wǎng)站留言板出現(xiàn)垃圾留言/評(píng)論實(shí)現(xiàn)思路
如何有效防止網(wǎng)站(留言板)出現(xiàn)垃圾留言,垃圾評(píng)論?本文提供詳細(xì)解決思路與實(shí)現(xiàn)步驟,需要了解的朋友可以參考下2012-12-12
關(guān)于網(wǎng)站文件自動(dòng)備份程序的一點(diǎn)思考
關(guān)于網(wǎng)站文件自動(dòng)備份程序的一點(diǎn)思考...2006-12-12

