以下的文章主要介紹的是MySQLSQL數據庫清空代碼 _php 清空mysql asp的實際操作情況,本文主要講述的是access或是mssql 2009-10-14 17:34asp 代碼的詳細解析,希望會給你帶來一些幫助在此方面。
復制代碼 代碼如下:
- <%
- 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 '
如果是用戶表
- 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數據庫;復制代碼 代碼如下:
- <?php
- $user = "readlog.cn";//賬號
- $password = "readlog.cn";//密碼
- $dbname = "readlog";//數據庫
- $link = mysql_connect("localhost:3306",$user,$password);
- mysql_select_db("$dbname",$link);
- echo "<p>正在清空數據庫...";
- $result=mysql_query("SHOW tables",$link);
- while ($currow=mysql_fetch_array($result));
- mysql_query("DROP TABLE IF EXISTS $currow[0]");
- echo "成功!";
- ?>
asp清空mssql
復制代碼 代碼如下:
- <%
- 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
- %>
以上的相關內容就是對MySQLSQL數據庫清空代碼的介紹,望你能有所收獲。