Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to back up SQL database files locally

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to back up SQL database files to the local", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to back up SQL database files to the local" bar!

Response.Charset= "utf-8"

Session.Codepage=65001

Response.Buffer=true

Response.Clear

Change the user name and password according to your situation

Constr= "Provider=SQLOLEDB.1;PersistSecurityInfo=True;UserID=endiva;Password=endiva;DataSource=211.160.78.6"

Setconn=server.createobject ("adodb.connection")

Conn.openconstr

Bkfname=server.mappath (Format_Time (Now (), 5) & "database.bak")

Sqlstr= "backupdatabasefangtodisk='" + bkfname+ "'withinit"

Conn.executesqlstr

Conn.close

Response.Write "database [fang] isbackupsuccess!

"

Response.Write "clickdownload"

How to back up SQL database files locally

If you want to back up and download directly, you can add this section below and it will be automatically saved after backup. But the pop-up file is a .asp file, modify it on OK.

'setfn=server.createobject ("adodb.stream")

'fn.mode=3' read and write

'The fn.type=1' data type is: adTypeBinary

'fn.open

'fn.LoadFromFilebkfname' mounts the file specified by bkfname into the object

'Response.ContentType= "application/octet-stream"

'Response.BinaryWritefn.read

'fn.close

Through the steps described above, you can easily back up the files of the SQL database to the local, convenient and fast, I hope everyone can have a good grasp, and then can help you in the future work.

Thank you for your reading, the above is the content of "how to back up the files of the SQL database to the local". After the study of this article, I believe you have a deeper understanding of how to back up the files of the SQL database to the local, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report