2012-09-12 20 views
0

我剛剛遇到這個項目,我不得不在一個網站的後端顯示一些圖像,因爲我已經使用了Classic Asp和SQL Server 2000,到目前爲止,我可以顯示數據庫中的大部分內容。 我無法弄清楚這個圖像的事情。我嘗試瞭解到目前爲止我所瞭解的情況,我創建了一個表格,其中有一個帶圖像數據類型的列,其中我不知道它是否正確。我應該如何繞過腳本來獲取圖像。如何使用經典的asp在sql server 2000中插入圖像。?

<table border="1" cellpadding="0" cellspacing="0" width="100%"> 
       <tr height="25px"> 
        <th width="25%">Cover Name</th> 
        <th width="25%">Category Name</th> 
        <th width="17%">Thumbs</th> 
        <th width="17%">&nbsp;</th> 
        <th width="17%">&nbsp;</th> 
       </tr> 
       <% 
        sql = "SELECT * from covers" 
        rs.open sql, con, 1, 2 
        do while not rs.eof 
       %> 
       <tr> 
        <td align="center"><%=rs("c_name")%></td> 
        <td align="center"><%=rs("category")%></td> 
        <td align="center"><%=rs("img")%></td> 
        <td align="center"><a href="edit.asp?cover=<%=rs("c_name")%>">Edit</a></td> 
        <td align="center"><a href="delete.asp?cover=<%=rs("c_name")%>" onclick="var r =confirm('This Cover details will be deleted permenantly . Are you sure you want to DELETE'); 
       { 
        if (r==true) 
        alert('record will be deleted'); 
        if (r==false) 
        return false; 
       }">Delete Info</a></td> 
       </tr> 
       <% 
        rs.movenext 
        loop 
        rs.close 
       %> 
       </table> 
+0

查看這些鏈接 - http://www.codeproject.com/Articles/21208/Store-or-Save-images-in-SQL-Server http://stackoverflow.com/questions/1328914/save-image-列到文件在SQL Server 2000中http://social.msdn.microsoft.com/Forums/en/transactsql/thread/a375ac9b-6cd1-424c-a337-94482c6977f8希望這可以幫助! –

回答

0

它會更好磁盤上的圖像文件存儲(大概是在Web服務器上),並且它們的文件名只存儲在數據庫中的「蓋」表?

道歉不直接回答你的問題,但在數據庫中存儲二進制文件的額外複雜性似乎並沒有提供任何很好的回報。

看到這個SO Post很多更多關於這個問題的信息。