[求助]实时错误,自己改不好
大家帮我看看下面这段程序,为什么当执行到红色语句时,会弹出“实时错误3001,参数类型不正确,。。。。”
Dim Filestm As New ADODB.Stream '“定义为二进制流,然后指明流的类型和模式”
Dim rs As New ADODB.Recordset
Dim Filestm As New ADODB.Stream '“定义为二进制流,然后指明流的类型和模式”
Dim rs As New ADODB.Recordset
Dim strName, conStr, sql As String
Private Sub Command1_Click()
If strName <> "" Then '保存图片
rs.Open "Select * from tb", conn, adOpenKeyset, adLockOptimistic
Filestm.Type = adTypeBinary
Filestm.Type = adTypeBinary
Filestm.Open
Filestm.LoadFromFile strName
rs.AddNew
rs.Fields("pic") = Filestm.Read
rs.Update
rs.AddNew
rs.Fields("pic") = Filestm.Read
rs.Update
Filestm.Close
MsgBox ("成功!")
End If
MsgBox ("成功!")
End If
End Sub
Private Sub Form_Load()
Dim conn As New ADODB.Connection
connstr = "provider=Microsoft.Jet.oledb.4.0;" & "data source=" & App.Path & "\cc.mdb"
conn.Open connstr
End Sub
connstr = "provider=Microsoft.Jet.oledb.4.0;" & "data source=" & App.Path & "\cc.mdb"
conn.Open connstr
End Sub
Private Sub Image1_Click()
If Image1.Enabled = True Then
On Error GoTo S1
Me.CommonDialog1.CancelError = True
Me.CommonDialog1.Filter = "JPEG(*.jpg)|*.jpg;*.jpeg|Windows位图,图标 (*.bmp;*.ico)|*.bmp;*.ico"
'指明打开图片的类型
Me.CommonDialog1.ShowOpen
'指明打开图片的类型
Me.CommonDialog1.ShowOpen
If Me.CommonDialog1.FileTitle = "" Then Exit Sub
strName = Me.CommonDialog1.FileName
Me.Image1.Picture = LoadPicture(strName)
' “加载图片”
' “加载图片”
Exit Sub
S1:
strName = ""
End If
End Sub