<>我在网上朋友的一个例子里面看到以下这段代码,是导入图片的,但是我把他用到我自己的数据库里面的时候却显示编译错误,说是Istm As ADODB.Stream这一段用户类型未定义?请问这是怎么回事呢?谢谢大家了。</P>
<>Sub SaveImage()<BR> Dim rs As New ADODB.Recordset<BR> Dim Istm As ADODB.Stream<BR> rs.Open "图库", CurrentProject.Connection, adOpenKeyset, adLockOptimistic<BR> Set Istm = New ADODB.Stream<BR> If Not IsNull(FileName) Then<BR> With Istm<BR> .Type = adTypeBinary<BR> .Open<BR> .LoadFromFile FileName<BR> End With<BR> End If</P>
<> rs.AddNew<BR> rs("图片") = Istm.Read<BR> rs.Update<BR> rs.Close<BR> Istm.Close<BR> Set rs = Nothing<BR> Set Istm = Nothing<BR> <BR>End Sub<BR></P>