开发者

How insert a blob in SQL Server without bulk and using ASP?

I need to upload files 'into' a SQL Server database.

I need a solution that do开发者_开发问答esn't involve bulk inserts.


Set ObjStr = Server.CreateObject("ADODB.Stream")
ObjStr.Type = 1 'AdBinary
ObjStr.Open

ObjStr.LoadFromFile "D:\file.pdf"

'Evita sql inject
Set oPreparedStatementADO              = Server.CreateObject("ADODB.Command")
oPreparedStatementADO.ActiveConnection = conexao
cSql = "INSERT INTO edital_editais(blob_field) values (?); "


oPreparedStatementADO.CommandText = cSQL

x = ObjStr.Read

oPreparedStatementADO.Parameters.Item(0) = x

set rs = oPreparedStatementADO.Execute
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜