關(guān)于Adodb.Stream的寫數(shù)據(jù)庫數(shù)據(jù)到客戶端文件的實(shí)踐
- 發(fā)布于:2020-05-31
- 共 266 人圍觀
網(wǎng)絡(luò)上流傳的這方面的東西不少,但多數(shù)是copy來的,很簡(jiǎn)單的事情搞得那么復(fù)雜。真正經(jīng)過實(shí)踐的東東少得可憐。于是自己寫了一個(gè),雖然簡(jiǎn)單,也有些問題,但是copy下去就可以用了。有問題的朋友可以跟我聯(lián)系,好一起學(xué)習(xí)。
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 "賬號(hào)"
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)載請(qǐng)說明出處:六百號(hào)技術(shù) - SEO優(yōu)化,網(wǎng)頁設(shè)計(jì),網(wǎng)絡(luò)編程,軟件技巧,網(wǎng)絡(luò)知識(shí),系統(tǒng)技術(shù) ? 關(guān)于Adodb.Stream的寫數(shù)據(jù)庫數(shù)據(jù)到客戶端文件的實(shí)踐
標(biāo)簽: