MySQLSQL數(shù)據(jù)庫(kù)清空代碼清空
以下的文章主要介紹的是MySQLSQL數(shù)據(jù)庫(kù)清空代碼 _php 清空mysql asp的實(shí)際操作情況,本文主要講述的是access或是mssql 2009-10-14 17:34asp 代碼的詳細(xì)解析,希望會(huì)給你帶來(lái)一些幫助在此方面。
復(fù)制代碼 代碼如下:
- <%
- Dim Rs,Conn
- Set Conn=Server.CreateObject("Adodb.Connection")
- Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath("readlog.mdb")
- Set Rs=Conn.OpenSchema(20)
- Do While not Rs.Eof
- If Ucase(Rs("TABLE_TYPE"))="TABLE" Then '
如果是用戶(hù)表
- Conn.Execute("Drop Table "&Rs("TABLE_NAME")&"")
- End If
- Rs.MoveNext
- Loop
- Response.Write "成功!"
- Rs.Close
- Set Rs=Nothing
- Conn.Close
- Set Conn=Nothing
- %>
php清空mysql
MySQLSQL數(shù)據(jù)庫(kù);復(fù)制代碼 代碼如下:
- <?php
- $user = "readlog.cn";//賬號(hào)
- $password = "readlog.cn";//密碼
- $dbname = "readlog";//數(shù)據(jù)庫(kù)
- $link = mysql_connect("localhost:3306",$user,$password);
- mysql_select_db("$dbname",$link);
- echo "<p>正在清空數(shù)據(jù)庫(kù)...";
- $result=mysql_query("SHOW tables",$link);
- while ($currow=mysql_fetch_array($result));
- mysql_query("DROP TABLE IF EXISTS $currow[0]");
- echo "成功!";
- ?>
asp清空mssql
復(fù)制代碼 代碼如下:
- <%
- Dim Rs,Conn
- Set Conn=Server.CreateObject("Adodb.Connection")
- Conn.Open "Provider=Sqloledb; User ID=readlog.cn; Password=readlog.cn; Initial Catalog =readlog; Data Source=(local);"
- Set Rs=Conn.Execute("Select name from sysobjects Where xtype=char(85) order by id")
- Do While Not Rs.Eof
- Conn.Execute("drop table table "&rs(0)&"")
- Rs.movenext
- loop
- Response.Write "成功!"
- Rs.Close
- Set Rs=Nothing
- Conn.Close
- Set Conn=Nothing
- %>
以上的相關(guān)內(nèi)容就是對(duì)MySQLSQL數(shù)據(jù)庫(kù)清空代碼的介紹,望你能有所收獲。
【編輯推薦】