VFP下的是: append gerneral <fieldname> from <your file path> vb下可能要用ADO,然后用INSERT-SQL,没试过,最好去VB版问下。
Dim rs As New ADODB.Recordset Dim mstream As New ADODB.Stream Private Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal DirPath As String) As Long '??ヘ? Private Sub Form_Load() objcn.ConnectionString = "driver=SQL Server;server=(LOCAL);database=Text" objcn.Open rs.Open "select * from Picture", objcn, adOpenKeyset, adLockOptimistic mstream.Type = adTypeBinary mstream.Open
append gerneral <fieldname> from <your file path>
vb下可能要用ADO,然后用INSERT-SQL,没试过,最好去VB版问下。
Dim mstream As New ADODB.Stream
Private Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal DirPath As String) As Long '??ヘ?
Private Sub Form_Load()
objcn.ConnectionString = "driver=SQL Server;server=(LOCAL);database=Text"
objcn.Open
rs.Open "select * from Picture", objcn, adOpenKeyset, adLockOptimistic
mstream.Type = adTypeBinary
mstream.Open
End Sub
Private Sub Command1_Click()
mstream.LoadFromFile "D:\Documents and Settings\21413688.jpg"
rs.AddNew
rs.Fields("Pic").Value = mstream.Read
rs("Num") = rs.RecordCount
rs.Update
End Sub