VB读取本地图片并保存到数据库中

        Set mstream = New ADODB.Stream
        mstream.Type = adTypeBinary
        mstream.Open
        mstream.LoadFromFile sFileName
    
        
        rstGraph.Open "select id, keyno,item,bithis,graphstream,instrument,thedate,sampleno from lis_graph_online where keyno = '" & strKey & "' and item = '" & sDir & "' order by id desc", conn, adOpenKeyset, adLockOptimistic
        If rstGraph.RecordCount > 0 Then
            rstGraph.Fields("graphstream") = mstream.Read
            rstGraph.Update
        Else
            rstGraph.AddNew
            rstGraph.Fields("keyno") = strKey
            rstGraph.Fields("item") = sDir
            rstGraph.Fields("bithis") = 0
           
            rstGraph.Fields("instrument") = strInstrument
            rstGraph.Fields("thedate") = Date
            rstGraph.Fields("sampleno") = as_SampleNo
            rstGraph.Fields("graphstream") = mstream.Read
            rstGraph.Update
        End If
        rstGraph.Close

发布了41 篇原创文章 · 获赞 4 · 访问量 12万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览