아래는 http://support.microsoft.com/kb/194799/ko 내용임...
요약
이 문서에서는 삽입하고 Oracle 데이터베이스를 사용할 수 있는 ASP (Active Server Pages) 페이지 RAW 또는 LONG RAW 데이터를 검색하는 방법에 대해 설명합니다.
추가 정보
1.Oracle 테이블을 이미지를 삽입하려면 다음 Microsoft 기술 자료의 다음 문서를 참조하십시오.
185958 (http://support.microsoft.com/kb/185958/EN-US/ ) AppendChunk ADO GetChunk BLOB 데이터용 Oracle 함께 사용하는 방법
참고: 우리는 Microsoft Access를 사용하여 Oracle에 이미지를 삽입할 사용하지 않는 것이 좋습니다. OLE 래퍼를 개체를 추출하여 ASP가 올바르게 해석되지 않도록 개체 주위에 추가됩니다.
2. 쿼리 및 이미지를 표시하는 다음 코드를 사용합니다.:
<%@ LANGUAGE="VBSCRIPT" %>
<%
'Clear existing HTTP header information.
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
'Set the HTTP header to an image type, if you want to display
'a jpg you need to use the "image/jpeg" content type.
Response.ContentType = "image/gif"
Dim strTemp
Set oConn = Server.CreateObject("ADODB.Connection")
'You need to change this line to reflect your DSN, UID
'and PWD.
oConn.Open "DSN=Ovteam;UID=userid;PWD=password;"
'Change this line to use your table that contains a raw or
'long raw field. In this case, ID is the primary key of the
'IMAGE table and IMG is the RAW or LONG RAW data column.
sSQL = "Select ID, IMG from IMAGE where ID = 1"
Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.Source = sSQL
oRS.ActiveConnection = oConn
'The cursor type does not seem to matter. A keyset cursor was used
'with success for this article; however, you will not be able to
'scroll with it because the content type of this page is set for
'"image/gif".
oRS.Open
strtemp = oRS("IMG")
Response.BinaryWrite(strTemp)
Response.End
oRS.Close
Set oRS = nothing
oConn.Close
Set oConn = nothing
%>
본 문서의 정보는 다음의 제품에 적용됩니다.
- Microsoft Open Database Connectivity 2.5
- Microsoft ActiveX Data Objects 2.0
- Microsoft ActiveX Data Objects 2.1
- Microsoft ActiveX Data Objects 2.1 서비스 팩 2
- Microsoft ActiveX Data Objects 2.5
- Microsoft ActiveX Data Objects 2.6
- Microsoft ActiveX Data Objects 2.7
- Microsoft Active Server Pages 4.0
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
키워드: |
kbmt kbcode kbhowto kboracle kbprovider KB194799 KbMtko |