图片的大小都在70K左右。以前都传得好好的。
最近开始经常出现超时的情况。
都是在Recordset的UPDATE操作上停住了。这是什么原因?或者有改良的方法吗?
Dim Stream1 As New ADODB.Stream
Stream1.Mode = adModeReadWrite
Stream1.Type = adTypeBinary
Stream1.Open
Stream1.LoadFromFile PicPath
Stream1.Position = 0 Dim Rs As New ADODB.Recordset
With Rs
CnPic.Execute "insert pic select '" & PicHh & "',null where (select isnull(count(hh),0) from pic where hh='" & PicHh & "')=0"
.Open "select * from pic where [hh]='" & PicHh & "'", CnPic, adOpenStatic, adLockOptimistic
If .RecordCount = 0 Then
.AddNew
.Fields(0) = PicHh
End If
.Fields("pic").AppendChunk Stream1.Read
.Update
Rs.Close
End With
最近开始经常出现超时的情况。
都是在Recordset的UPDATE操作上停住了。这是什么原因?或者有改良的方法吗?
Dim Stream1 As New ADODB.Stream
Stream1.Mode = adModeReadWrite
Stream1.Type = adTypeBinary
Stream1.Open
Stream1.LoadFromFile PicPath
Stream1.Position = 0 Dim Rs As New ADODB.Recordset
With Rs
CnPic.Execute "insert pic select '" & PicHh & "',null where (select isnull(count(hh),0) from pic where hh='" & PicHh & "')=0"
.Open "select * from pic where [hh]='" & PicHh & "'", CnPic, adOpenStatic, adLockOptimistic
If .RecordCount = 0 Then
.AddNew
.Fields(0) = PicHh
End If
.Fields("pic").AppendChunk Stream1.Read
.Update
Rs.Close
End With
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货