Save to your hard drive with AdoDb.Stream will save to your hard drive

zhaozj2021-02-16  68

For files in the uploaded database, you need to save the file on your hard disk. The following code takes the Access database as an example, how to save the file to your hard disk table by adoDb.stream: Demo structure ====== ============================================================================================================================================================================ ============================================================================================================================================================== # Server.mappath ("Demo.mdb") "; driver = {Microsoft Access Driver (* .mdb)};" SET CONN = Server.createObject ("AdoDb.Connection" Conn.open Connstr SQL = "SELECT * from demo where id = 1 "Set Rs = Server.CreateObject (" Adodb.RecordSet ") Rs.Open Sql, Conn, 1,3Set MyStream = Server.CreateObject MyStream.Type = 1MyStream.OpenMyStream (" Adodb.Stream "). Write RS ("DATA"). GetChunk (RS ("Data"). Actsize-78) MyStream.savetofile "C: /" & et ("filename") rs.closset = nothingconn.closset conn = Nothing%>

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

New Post(0)