首页 > 代码库 > ASP + ACCESS保存图片文件之实现

ASP + ACCESS保存图片文件之实现

con.execute "CREATE tblImg (lngId COUNTER PRIMARY KEY, binImg IMAGE)"
 
set ads=createobject("adodb.stream")
ads.type=1
ads.mode=3
ads.open
ads.loadFromFile "test.jpg"
 
 
set rst=createobject("adodb.recordset")
rst.open "tblImg",con,0,3,2
rst.addNew
ads.Position=0
rst("binImg").appendChunk ads.read()
ads.close
rst.update