Batch reading pictures to the database

xiaoxiao2021-03-06  30

<%

'Suppose the picture path is path = "d: / photo /"

SET RS = conn.execute ("Select ID from Youtable")

Set ads = creteObject ("adodb.stream")

SET RS2 = Server.createObject ("AdoDb.Recordset")

Ads.Mode = 3

Ads.Type = 1

Set id = rs ("id")

Do while rs.eof = false

ADS.OPEN

Ads.LoadFromfile (Path & ID & ". JPG")

rs2.open "Select * from you Id =" & id, conn, 1, 3

Rs2.addnew

RS2 ("photo") = ads.read ()

Rs2.Update

RS2.Close

ADS.CLOSE

rs.movenext

loop

Set id = Nothing

SET RS2 = Nothing

Set ads = Nothing

SET RS = Nothing

%>

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

New Post(0)