通過(guò)實(shí)例介紹了asp創(chuàng)建sqlserver 或者access表.和刪除表
<%
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
'連接MS Server
connstr="provider=SQLOLEDB;Server=ServerName;database=DbName;user id=sa;password=pwd"
'連接MS Access
'connstr="driver={microsoft access driver (*.mdb)};dbq=" & server.mappath("mydata.mdb")
conn.open connstr
'創(chuàng)建表test
sql="create table Test (user_name char(20) null,user_pwd char(20) null)"
rs.open sql,conn,3,3
'插入數(shù)據(jù)
sql="insert into Test values('myname','mypwd')"
rs.open sql,conn,3,3
'刪除表test
sql="drop table Test"
rs.open sql,conn,3,3
%>
更多信息請(qǐng)查看IT技術(shù)專欄