各位大侠,oracle数据库中有一个blob字段,里面存有doc和jpg,我能用asp读取并把他们显示出来吗?
各位大侠,oracle数据库中有一个blob字段,里面存有doc和jpg,我能用asp读取并把他们显示出来吗?尽可能的提供源码?拜托,谢谢各位!运行报错,提示内部错误,无...
各位大侠,oracle数据库中有一个blob字段,里面存有doc和jpg,我能用asp读取并把他们显示出来吗?尽可能的提供源码?拜托,谢谢各位!
运行报错,提示内部错误,无法打开页面,代码如下,我的table表里的字段dx为blob型,里面取得是一个doc文件,请问哪儿错了?怎么改?万分感谢!!
<%Set rs=OraDatabase.DbCreateDynaset("select dx from table where id=5",4)
Function
Dim dtimage As New DataTable
dtimage = rs("dx") '获得blob字段内容
Dim btImage As Byte()
btImage = dtimage.Rows(0)("dx")
Dim ms As System.IO.MemoryStream
ms = New MemoryStream(btImage)
'创建一个bitmap,doc的话要引用office的lib而后创建doc
Dim doc As Microsoft.office.Interop.word.document
bmp = New Bitmap(ms)
Return bmp
End Function %> 展开
运行报错,提示内部错误,无法打开页面,代码如下,我的table表里的字段dx为blob型,里面取得是一个doc文件,请问哪儿错了?怎么改?万分感谢!!
<%Set rs=OraDatabase.DbCreateDynaset("select dx from table where id=5",4)
Function
Dim dtimage As New DataTable
dtimage = rs("dx") '获得blob字段内容
Dim btImage As Byte()
btImage = dtimage.Rows(0)("dx")
Dim ms As System.IO.MemoryStream
ms = New MemoryStream(btImage)
'创建一个bitmap,doc的话要引用office的lib而后创建doc
Dim doc As Microsoft.office.Interop.word.document
bmp = New Bitmap(ms)
Return bmp
End Function %> 展开
1个回答
展开全部
Function GetPic(ByVal id As String) As System.Drawing.Bitmap
Dim dtimage As New DataTable
Dim sqlstr As String = "select picture from tb_pict where id=" & id
dtimage = getOracle(sqlstr) '获得blob字段内容
Dim btImage As Byte()
btImage = dtimage.Rows(0)("picture")
Dim ms As System.IO.MemoryStream
ms = New MemoryStream(btImage)
'创建一个bitmap,doc的话要引用office的lib而后创建doc
Dim bmp As System.Drawing.Bitmap
bmp = New Bitmap(ms)
Return bmp
End Function
追问
'创建一个bitmap,doc的话要引用office的lib而后创建doc,具体代码怎么写?能告诉我吗?谢谢!
追答
创建一个bitmap
Dim bmp As System.Drawing.Bitmap
创建doc
Dim doc As Microsoft.office.Interop.word.document
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询