asp建立mdb数据库表和字段的代码
asp建立mdb数据库表和字段的代码
<%
Set conn1 = Server.CreateObject("ADODB.Connection")
conn1.Open "DBQ="& Server.MapPath("数据库名.mdb") &";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;"
sql = "CREATE TABLE 学员1 (姓名 TEXT(10), 年龄 INT)"
Set a = conn1.Execute(sql)
Response.Write "CREATE TABLE OK"
sql = "ALTER TABLE 学员1 ADD COLUMN 性别 TEXT(2)"
Set a = conn1.Execute(sql)
Response.Write "ALTER TABLE OK"
conn1.Close
%>