關(guān)于Adodb.Stream的寫數(shù)據(jù)庫數(shù)據(jù)到客戶端文件的實踐
- 發(fā)布于:2020-05-31
- 共 263 人圍觀
網(wǎng)絡(luò)上流傳的這方面的東西不少,但多數(shù)是copy來的,很簡單的事情搞得那么復雜。真正經(jīng)過實踐的東東少得可憐。于是自己寫了一個,雖然簡單,也有些問題,但是copy下去就可以用了。有問題的朋友可以跟我聯(lián)系,好一起學習。
filemystream=server.mappath("new") & "\temp.htm"
Set MyStream=Server.CreateObject("Adodb.Stream")
MyStream.Type = 1
MyStream.Mode=3
MyStream.Open
MyStream.LoadFromFile(filemystream)
Response.ContentType="application/octet-stream"
Response.AddHeader "Content-Disposition:","attachment; filename=" & "bk.txt"
Range=Mid(Request.ServerVariables("HTTP_RANGE"),7)
response.write "姓名"
response.write "賬號"
response.write "地址"
response.write "說明"
cr=chr(13)&chr(10)
response.write(cr)
while not rs.eof
response.write rs("name")
response.write rs("accno")
response.write rs("address")
response.write rs("note")
response.write(cr)
RS.MoveNext
wend
rs.close
set rs=nothing
Conn.Close
Set Conn=Nothing
Mystream.close
set Mystream=nothing
轉(zhuǎn)載請說明出處:六百號技術(shù) - SEO優(yōu)化,網(wǎng)頁設(shè)計,網(wǎng)絡(luò)編程,軟件技巧,網(wǎng)絡(luò)知識,系統(tǒng)技術(shù) ? 關(guān)于Adodb.Stream的寫數(shù)據(jù)庫數(shù)據(jù)到客戶端文件的實踐
標簽: