Back up your reform of the ACCESS database

xiaoxiao2021-03-06  82

There is a problem about the ACCESS database in the recent background of the OA system of a company. In order to prevent the database from downloading for uncomfortable people, you need to change the suffix of the database as ASPX (ASP and other options), and the company's internal personnel need to download the database through IE to back up the database. Of course, by modifying the file name suffix method, it is not a special method. After all, it can see this in a Database or a web compared to the ASPX page of the M-unit. page. However, it is a simple way to go. First, purely simply modify the database file suffix aspx does not fully guarantee that it will not be downloaded, you download this ASPX page to modify the back to the retrore name to restore the database. (As mentioned earlier, it is possible to see which pages are made by databases.) Here you need to make some hands and feet, add <%%>, you can make IIS as ASPX page processing, Thus returning an error instead of downloading. It is not easy to add, you need to create a text file containing <%%>, then add a table in the original database, add a field of an OLE object, then add a record, the content of the OLE object field points to the previously established text. Then there is how the people you can download the database normally. Enter the database file to the client through the .NET's HTTPRESPONSE object. Modify the HTTP header: HttpContext.Current.Response.AppendHeader ( "Content-disposition", "attachment; filename = backup.mdb"); HttpContext.Current.Response.ContentType = "application / ms-access"; input file to the client : Long filesize = new fileinfo (dbpath) .length; response.writefile (dbpath, 0, filesis); Basic is this ~

转载请注明原文地址:https://www.9cbs.com/read-104745.html

New Post(0)