asp php 清空access mysql mssql数据库的代码
时间:2023-11-20 21:49:13
asp代码
<%
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
<?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
%>
标签:清空,access,mysql,mssql,数据库
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
详解ASP图片上传保存到数据库功能
2008-01-25 18:47:00
oracle快速删除重复的记录
2010-07-23 13:03:00
Python tkinter模块弹出窗口及传值回到主窗口操作详解
2023-09-27 23:03:05
![](https://img.aspxhome.com/file/2023/3/61173_0s.jpg)
基于PyQt5实现一个无线网连接器
2023-01-14 19:15:19
python定时检测无响应进程并重启的实例代码
2023-11-29 11:00:39
Python字符串常规操作小结
2023-12-02 08:33:23
![](https://img.aspxhome.com/file/2023/2/66322_0s.png)
golang映射Map的方法步骤
2023-08-28 09:10:22
在sqlserver2005中安装sql server 2000的示例数据库northwind的方法
2024-01-18 11:00:12
pytorch中关于distributedsampler函数的使用
2023-01-18 01:10:01
![](https://img.aspxhome.com/file/2023/9/98859_0s.png)
Selenium之模拟登录铁路12306的示例代码
2022-01-22 17:06:27
![](https://img.aspxhome.com/file/2023/7/92077_0s.png)
python之 matplotlib和pandas绘图教程
2021-07-16 01:50:11
![](https://img.aspxhome.com/file/2023/5/133775_0s.jpg)
Python图像处理PIL各模块详细介绍(推荐)
2024-01-01 18:31:43
![](https://img.aspxhome.com/file/2023/5/112815_0s.jpg)
基于php权限分配的实现代码
2023-11-14 11:10:49
![](https://img.aspxhome.com/file/2023/3/94503_0s.png)
详解Python多线程Selenium跨浏览器测试
2023-05-05 08:10:11
![](https://img.aspxhome.com/file/2023/8/115608_0s.png)
JS判断鼠标从什么方向进入一个容器实例说明
2024-04-28 09:48:35
![](https://img.aspxhome.com/file/2023/3/132763_0s.png)
MySQL删除数据Delete与Truncate语句使用比较
2024-01-15 05:12:42
MySQL单表查询操作实例详解【语法、约束、分组、聚合、过滤、排序等】
2024-01-24 14:41:24
SQL Serve数据库到DB2连接服务器的实现过程全解
2010-08-31 15:06:00
Mobile Web下的编码设计
2010-01-28 10:42:00
![](https://img.aspxhome.com/file/UploadPic/20101/28/mobile-web-75s.jpg)
Python3之简单搭建自带服务器的实例讲解
2022-03-05 20:50:33
![](https://img.aspxhome.com/file/2023/4/102764_0s.jpg)