Private Sub Command3_Click() Dim conn As New ADODB.Connection conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\1.mdb;Persist Security Info=False" conn.Execute "create table a (b longbinary)" End SubPrivate Sub Command4_Click() Dim b As New ADODB.Recordset Dim c As New ADODB.Stream c.Mode = adModeReadWrite c.Type = adTypeBinary c.Open c.LoadFromFile "c:\1.bmp" b.Open "select * from a", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\1.mdb;Persist Security Info=False", adOpenDynamic, adLockOptimistic b.AddNew
Set b = New ADODB.Recordset b.Open "select * from a", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\1.mdb;Persist Security Info=False", adOpenKeyset, adLockOptimistic b.MoveLast c.Write (b.Fields.Item(0).Value) c.SaveToFile "c:\aa.bmp", adSaveCreateOverWrite Picture1.Picture = LoadPicture("c:\aa.bmp") End Sub
Dim conn As New ADODB.Connection
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\1.mdb;Persist Security Info=False"
conn.Execute "create table a (b longbinary)"
End SubPrivate Sub Command4_Click()
Dim b As New ADODB.Recordset
Dim c As New ADODB.Stream
c.Mode = adModeReadWrite
c.Type = adTypeBinary
c.Open
c.LoadFromFile "c:\1.bmp"
b.Open "select * from a", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\1.mdb;Persist Security Info=False", adOpenDynamic, adLockOptimistic
b.AddNew
b.Fields.Item(0).Value = c.Read()
b.Update
b.Close
Set b = New ADODB.Recordset
b.Open "select * from a", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\1.mdb;Persist Security Info=False", adOpenKeyset, adLockOptimistic
b.MoveLast
c.Write (b.Fields.Item(0).Value)
c.SaveToFile "c:\aa.bmp", adSaveCreateOverWrite
Picture1.Picture = LoadPicture("c:\aa.bmp")
End Sub