ASP顯示ACCESS數據庫的GIF圖象_Access數據庫教程
推薦:access數據庫的數據轉換使用access數據庫時可能用到的數據轉換: 類型轉換涵數: 函數 返回類型 expression 參數范圍 CBool Boolean 任何有效的字符串或數值表達式。 CByte Byte 0 至 255。 CCur Currenc
寫入:
1:把gif圖像文件讀入內存(一個變量strTemp)。
2:寫入數據庫。
以下為引用的內容:
Dim binTmp() As Byte
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strSql As String
Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset
conn.Open "db"
strSql = "select * from tbImage"
rs.Open strSql, conn, 1, 3
OpenFile ("bayshore.jpg")
'請自己實現OpenFile函數
rs.AddNew
rs.Fields("image").AppendChunk binTmp
rs.Update
讀出和顯示:
以下為引用的內容:
show.asp:
<%
dim P
dim L
L = 8192
dim conn,rs,strSql
set conn=server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &server.MapPath(".") & "db2.mdb;Persist Security Info=False"
set rs=server.CreateObject("ADODB.Recordset")
strSql = "select * from tbImage"
Response.ContentType = "image/gif"
'Important!
rs.open strSql,conn,1,1
rs.movelast
do
P = rs("image").GetChunk(L)
Response.BinaryWrite P
IF LenB(P) < L then exit do
loop
%>
在html中:
<image src=show.asp>
分享:淺議ACCESS統計不重復記錄個數問題我在ACEESS做了一個窗體,內含一個子窗體,子窗體的控件來源是一個沒有篩選條件的查詢,在窗體里用VBA生成子窗體篩選條件。 例:在窗體輸入篩選條件后,子窗體篩選結果為: 客戶
- 相關鏈接:
- 教程說明:
Access數據庫教程-ASP顯示ACCESS數據庫的GIF圖象
。