加入收藏 | 设为首页 | 会员中心 | 我要投稿 温州站长网 (https://www.0577zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

用sql语句动态的创建access表 - ASP教程

发布时间:2016-08-03 21:38:37 所属栏目:Asp教程 来源:站长网
导读:用sql语句动态的创建access表的代如下! % nowtime = now() tablename = cstr(year(nowtime))+_+cstr(second(nowtime)) response.write tablename db_path = te
用sql语句动态的创建access表的代如下!

<%
nowtime = now()
tablename = cstr(year(nowtime))+"_"+cstr(second(nowtime))
response.write tablename
db_path = "test.mdb"
Set conn= Server.CreateObject("ADODB.Connection")
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(db_path)
conn.Open connstr
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "create table "& tablename &" (id integer primary key,name text,Birthday datetime)"
rs.Open sql,conn,2,3
%>

(编辑:温州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读