日期:2014-05-16 浏览次数:20795 次
set rs=server.createobject("adodb.recordset")
on error resume next ’这里要是不加这句,就报错
rs.open tablename1,conn '打开你要的表table1之一
if err.number=0 then '如果表存在
Err.Clear '清除该错误
Response.write "<br />This table names "&tablename1&" had been existed" '提示表存在
else
tablesql="create table "&tablename1&"("
tablesql=tablesql+"id autoincrement primary key,"
tablesql=tablesql+"username varchar(20),"
tablesql=tablesql+"psw varchar(200),"
tablesql=tablesql+"email varchar(100),"
tablesql=tablesql+"tel varchar(100),"
tablesql=tablesql+"perma varchar(100),"
tablesql=tablesql+"permb varchar(100),"
tablesql=tablesql+"permc varchar(100),"
tablesql=tablesql+"infotime datetime default now()"
tablesql=tablesql+")"
rs.open tablesql,conn,1,3
rs.close
set rs=nothing
response.write("<br />The table names "&tablename1&" had been created succesful")
Sql = "insert into "&tablename1&"(username,psw) values"
Sql = Sql& " ('admin','97cd91c4170cda38')"'默认密码1-8
conn.execute(sql)
end if
sql="select 1 from system_parameter..sysObjects Where Name ='你的表名' "
rs.open sql,conn,1,1
if not rs.eof then '表已经存在