Open Me.CommonDialog1.FileName For Binary As #1
ReDim bit(LOF(1)) As Byte
Get 1, 1, bit
Close 1
'然后将字节数组的内容写入数据库即可
'Set rst = New ADODB.Recordset
Dim cnn As New ADODB.Connection, rst As New ADODB.Recordset
cnn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=pubs;Data Source=(local)"
rst.Open "test1", cnn, adOpenKeyset, adLockOptimistic
rst.AddNew
rst("No") = 2003
rst("Comment") = "aaaa you!"
rst("image").AppendChunk bit
rst.Update