asp创建ACCESS表

作者在 2008-04-17 18:10:08 发布以下内容

<%
Function CreateTableName(TableName)
TableSql="CREATE TABLE "&TableName&" ("
TableSql=TableSql+"UserID autoincrement PRIMARY KEY,"
TableSql=TableSql+"UserName VARCHAR(20),"
TableSql=TableSql+"Password VARCHAR(16),"

TableSql=TableSql+"GradeLevel Long,"
TableSql=TableSql+"GradeName VARCHAR(20),"
TableSql=TableSql+"PostID Long,"
TableSql=TableSql+"PostName VARCHAR(20),"

TableSql=TableSql+"UserRealName VARCHAR(10),"
TableSql=TableSql+"UserSex VARCHAR(10),"
TableSql=TableSql+"UserTel VARCHAR(20),"
TableSql=TableSql+"UserMobile VARCHAR(20),"

TableSql=TableSql+"WorkQQ VARCHAR(20),"
TableSql=TableSql+"WorkEmail VARCHAR(60),"
TableSql=TableSql+"WorkMSN VARCHAR(60),"
TableSql=TableSql+"WorkDuty VARCHAR(20),"

TableSql=TableSql+"CheckStatus BIT NOT NULL,"
TableSql=TableSql+"CheckUser VARCHAR(20),"
TableSql=TableSql+"CheckTime DateTime,"
TableSql=TableSql+"CheckIP VARCHAR(16),"
TableSql=TableSql+"CheckFrom VARCHAR(100),"

TableSql=TableSql+"AddUser VARCHAR(20),"
TableSql=TableSql+"AddTime DateTime,"
TableSql=TableSql+"AddIP VARCHAR(16),"
TableSql=TableSql+"AddFrom VARCHAR(100),"

TableSql=TableSql+"UpdateUser VARCHAR(20),"
TableSql=TableSql+"UpdateTime DateTime,"
TableSql=TableSql+"UpdateIP VARCHAR(16),"
TableSql=TableSql+"UpdateFrom VARCHAR(100),"

TableSql=TableSql+"TotalLoginTimes Long,"

TableSql=TableSql+"LoginTime DateTime,"
TableSql=TableSql+"LoginIP VARCHAR(16),"
TableSql=TableSql+"LoginFrom VARCHAR(100),"

TableSql=TableSql+"LastLoginTime DateTime,"
TableSql=TableSql+"LastLoginIP VARCHAR(16),"
TableSql=TableSql+"LastLoginFrom VARCHAR(100)"

TableSql=TableSql+")"


response.Write("<br>正在执行数据库操作语句"&TableSql)
conn.execute(TableSql)
if err then
response.Write("<br>发生系统错误")
response.Write(err.description)
else
response.Write("<br>语句执行成功")
end if

end Function
%>

ASP技术 | 阅读 2247 次
文章评论,共0条
游客请输入验证码