By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,364 Members | 1,254 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,364 IT Pros & Developers. It's quick & easy.

Retrieving an image from an access database

P: 2
Hi everyone

For reasons best known to our IT department, my department is not allowed to use SQL. Instead we have to use Access. No problem there, except we have a need to store images into a database for security reasons. I have now spent over a day and a half trying to crack this. I know it is something to do with stripping the headers from the image held in the database. I did come across an example in c# on this site, but couldn’t convert that code into

My current code behind page looks like this and produces gibberish

Option Strict Off
Imports System
Imports System.Web.UI

Imports System.Data
Imports System.Data.OleDb
Imports System.Configuration

Public Class PublicGuidelineList: Inherits Page

public strImage as string
Public strConnString as String = ConfigurationSettings.AppSettings("ConnectionStrin g")
public objConn as New OleDbConnection(strConnString)

Sub Page_Load(Src As Object, E As EventArgs)
If Not Page.IsPostBack

End If
End sub

sub bindData()

strImage = "SELECT * FROM table1 "

' Create & execute OleDbCommand query to return records
dim ocd as OleDBCommand = New oleDbCommand(strImage, objConn)
dim myDataReader as oleDBdatareader


Response.binaryWrite(myDataReader.Item("signature" ))

end sub

end class

If anyone has a snippet, I would be grateful.
Jul 30 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.